File tree 11 files changed +100
-11
lines changed
compiler/rustc_middle/src/ty
ui/traits/non_lifetime_binders
11 files changed +100
-11
lines changed Original file line number Diff line number Diff line change @@ -2827,11 +2827,11 @@ impl<'tcx> Ty<'tcx> {
2827
2827
2828
2828
ty:: Adt ( def, _args) => def. sized_constraint ( tcx) . skip_binder ( ) . is_empty ( ) ,
2829
2829
2830
- ty:: Alias ( ..) | ty:: Param ( _) | ty:: Placeholder ( ..) => false ,
2830
+ ty:: Alias ( ..) | ty:: Param ( _) | ty:: Placeholder ( ..) | ty :: Bound ( .. ) => false ,
2831
2831
2832
2832
ty:: Infer ( ty:: TyVar ( _) ) => false ,
2833
2833
2834
- ty:: Bound ( .. ) | ty :: Infer ( ty:: FreshTy ( _) | ty:: FreshIntTy ( _) | ty:: FreshFloatTy ( _) ) => {
2834
+ ty:: Infer ( ty:: FreshTy ( _) | ty:: FreshIntTy ( _) | ty:: FreshFloatTy ( _) ) => {
2835
2835
bug ! ( "`is_trivially_sized` applied to unexpected type: {:?}" , self )
2836
2836
}
2837
2837
}
Original file line number Diff line number Diff line change @@ -20,10 +20,10 @@ use crate::str;
20
20
/// in each pair are borrowed references; the latter are owned
21
21
/// strings.
22
22
///
23
- /// Note that this structure is **not** `repr(C)` and is not recommended to be
24
- /// placed in the signatures of FFI functions. Instead, safe wrappers of FFI
25
- /// functions may leverage the unsafe [`CStr::from_ptr`] constructor to provide
26
- /// a safe interface to other consumers.
23
+ /// Note that this structure does **not** have a guaranteed layout (the `repr(transparent)`
24
+ /// notwithstanding) and is not recommended to be placed in the signatures of FFI functions.
25
+ /// Instead, safe wrappers of FFI functions may leverage the unsafe [`CStr::from_ptr`] constructor
26
+ /// to provide a safe interface to other consumers.
27
27
///
28
28
/// [`CString`]: ../../std/ffi/struct.CString.html
29
29
/// [`String`]: ../../std/string/struct.String.html
Original file line number Diff line number Diff line change @@ -303,12 +303,11 @@ pub struct IntoIter<T> {
303
303
rx : Receiver < T > ,
304
304
}
305
305
306
- /// The sending-half of Rust's asynchronous [`channel`] type. This half can only be
307
- /// owned by one thread, but it can be cloned to send to other threads.
306
+ /// The sending-half of Rust's asynchronous [`channel`] type.
308
307
///
309
308
/// Messages can be sent through this channel with [`send`].
310
309
///
311
- /// Note: all senders (the original and the clones) need to be dropped for the receiver
310
+ /// Note: all senders (the original and its clones) need to be dropped for the receiver
312
311
/// to stop blocking to receive messages with [`Receiver::recv`].
313
312
///
314
313
/// [`send`]: Sender::send
Original file line number Diff line number Diff line change @@ -469,7 +469,9 @@ fn run_test(
469
469
// Run the code!
470
470
let mut cmd;
471
471
472
+ let output_file = make_maybe_absolute_path ( output_file) ;
472
473
if let Some ( tool) = runtool {
474
+ let tool = make_maybe_absolute_path ( tool. into ( ) ) ;
473
475
cmd = Command :: new ( tool) ;
474
476
cmd. args ( runtool_args) ;
475
477
cmd. arg ( output_file) ;
@@ -503,6 +505,20 @@ fn run_test(
503
505
Ok ( ( ) )
504
506
}
505
507
508
+ /// Converts a path intended to use as a command to absolute if it is
509
+ /// relative, and not a single component.
510
+ ///
511
+ /// This is needed to deal with relative paths interacting with
512
+ /// `Command::current_dir` in a platform-specific way.
513
+ fn make_maybe_absolute_path ( path : PathBuf ) -> PathBuf {
514
+ if path. components ( ) . count ( ) == 1 {
515
+ // Look up process via PATH.
516
+ path
517
+ } else {
518
+ std:: env:: current_dir ( ) . map ( |c| c. join ( & path) ) . unwrap_or_else ( |_| path)
519
+ }
520
+ }
521
+
506
522
/// Transforms a test into code that can be compiled into a Rust binary, and returns the number of
507
523
/// lines before the test code begins as well as if the output stream supports colors or not.
508
524
pub ( crate ) fn make_test (
Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ include ../tools.mk
3
3
4
4
# Check that valid binaries are persisted by running them, regardless of whether the --run or --no-run option is used.
5
5
6
- all : run no_run
6
+ MY_SRC_DIR := ${CURDIR}
7
+
8
+ all : run no_run test_run_directory
7
9
8
10
run :
9
11
mkdir -p $(TMPDIR ) /doctests
@@ -20,3 +22,12 @@ no_run:
20
22
$(TMPDIR ) /doctests/t_rs_2_0/rust_out
21
23
$(TMPDIR ) /doctests/t_rs_8_0/rust_out
22
24
rm -rf $(TMPDIR ) /doctests
25
+
26
+ # Behavior with --test-run-directory with relative paths.
27
+ test_run_directory :
28
+ mkdir -p $(TMPDIR ) /doctests
29
+ mkdir -p $(TMPDIR ) /rundir
30
+ $(RUSTC ) --crate-type rlib t.rs
31
+ ( cd $( TMPDIR) ; \
32
+ $(RUSTDOC ) -Zunstable-options --test --persist-doctests doctests --test-run-directory rundir --extern t=libt.rlib $(MY_SRC_DIR ) /t.rs )
33
+ rm -rf $(TMPDIR ) /doctests $(TMPDIR ) /rundir
Original file line number Diff line number Diff line change
1
+ # ignore-cross-compile
2
+ include ../tools.mk
3
+
4
+ # Tests behavior of rustdoc --runtool
5
+
6
+ MY_SRC_DIR := ${CURDIR}
7
+
8
+ all : with_test_run_directory
9
+
10
+ # Behavior with --runtool with relative paths and --test-run-directory.
11
+ with_test_run_directory :
12
+ mkdir -p $(TMPDIR ) /rundir
13
+ mkdir -p $(TMPDIR ) /runtool
14
+ $(RUSTC ) --crate-type rlib t.rs
15
+ $(RUSTC ) runtool.rs -o $(TMPDIR ) /runtool/runtool
16
+ ( cd $( TMPDIR) ; \
17
+ $(RUSTDOC ) -Zunstable-options --test --test-run-directory rundir \
18
+ --runtool runtool/runtool --extern t=libt.rlib $(MY_SRC_DIR ) /t.rs \
19
+ )
20
+ rm -rf $(TMPDIR ) /rundir $(TMPDIR ) /runtool
Original file line number Diff line number Diff line change
1
+ fn main ( ) {
2
+ eprintln ! ( "{:?}" , std:: env:: args( ) . collect:: <Vec <_>>( ) ) ;
3
+ }
Original file line number Diff line number Diff line change
1
+ /// Fungle the foople.
2
+ /// ```
3
+ /// t::foople();
4
+ /// ```
5
+ pub fn foople ( ) { }
6
+
7
+ /// Flomble the florp
8
+ /// ```
9
+ /// t::florp();
10
+ /// ```
11
+ pub fn florp ( ) { }
Original file line number Diff line number Diff line change
1
+ // check-pass
2
+
3
+ #![ feature( non_lifetime_binders) ]
4
+ //~^ WARN is incomplete and may not be safe
5
+
6
+ pub fn foo ( )
7
+ where
8
+ for < V > V : Sized ,
9
+ {
10
+ bar ( ) ;
11
+ }
12
+
13
+ pub fn bar ( )
14
+ where
15
+ for < V > V : Sized ,
16
+ {
17
+ }
18
+
19
+ pub fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
2
+ --> $DIR/sized-late-bound-issue-114872.rs:3:12
3
+ |
4
+ LL | #![feature(non_lifetime_binders)]
5
+ | ^^^^^^^^^^^^^^^^^^^^
6
+ |
7
+ = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
8
+ = note: `#[warn(incomplete_features)]` on by default
9
+
10
+ warning: 1 warning emitted
11
+
Original file line number Diff line number Diff line change @@ -386,7 +386,6 @@ cc = ["@camelid"]
386
386
message = " Some changes occurred in HTML/CSS/JS."
387
387
cc = [
388
388
" @GuillaumeGomez" ,
389
- " @Folyd" ,
390
389
" @jsha" ,
391
390
]
392
391
You can’t perform that action at this time.
0 commit comments