diff --git a/src/test/codegen/enum-debug-niche-2.rs b/src/test/codegen/enum-debug-niche-2.rs index aa6cbf66b4a..0f17976ef49 100644 --- a/src/test/codegen/enum-debug-niche-2.rs +++ b/src/test/codegen/enum-debug-niche-2.rs @@ -13,7 +13,6 @@ // CHECK: {{.*}}DIDerivedType{{.*}}tag: DW_TAG_member,{{.*}}name: "Error",{{.*}}extraData: i64 0{{[,)].*}} #![feature(never_type)] -#![feature(nll)] #[derive(Copy, Clone)] pub struct Entity { diff --git a/src/test/mir-opt/remove_fake_borrows.rs b/src/test/mir-opt/remove_fake_borrows.rs index 144348450a9..8348f9a7746 100644 --- a/src/test/mir-opt/remove_fake_borrows.rs +++ b/src/test/mir-opt/remove_fake_borrows.rs @@ -2,8 +2,6 @@ // ignore-wasm32-bare -#![feature(nll)] - fn match_guard(x: Option<&&i32>, c: bool) -> i32 { match x { Some(0) if c => 0, diff --git a/src/test/run-fail/issue-51345.rs b/src/test/run-fail/issue-51345.rs index 3c7f6a68db5..c62f98ea78d 100644 --- a/src/test/run-fail/issue-51345.rs +++ b/src/test/run-fail/issue-51345.rs @@ -1,7 +1,5 @@ // error-pattern: thread 'main' panicked at 'explicit panic' -#![feature(nll)] - fn main() { let mut vec = vec![]; vec.push((vec.len(), panic!())); diff --git a/src/test/run-pass/borrowck/borrowck-multiple-borrows-interior-boxes.rs b/src/test/run-pass/borrowck/borrowck-multiple-borrows-interior-boxes.rs index c953bed26f4..96d2663500e 100644 --- a/src/test/run-pass/borrowck/borrowck-multiple-borrows-interior-boxes.rs +++ b/src/test/run-pass/borrowck/borrowck-multiple-borrows-interior-boxes.rs @@ -3,8 +3,6 @@ #![allow(unused_variables)] // Test case from #39963. -#![feature(nll)] - #[derive(Clone)] struct Foo(Option>, Option>); diff --git a/src/test/run-pass/borrowck/borrowck-unused-mut-locals.rs b/src/test/run-pass/borrowck/borrowck-unused-mut-locals.rs index 8f0434c0e2b..fd0e346e2b4 100644 --- a/src/test/run-pass/borrowck/borrowck-unused-mut-locals.rs +++ b/src/test/run-pass/borrowck/borrowck-unused-mut-locals.rs @@ -1,5 +1,4 @@ // run-pass -#![feature(nll)] #![deny(unused_mut)] #[derive(Debug)] diff --git a/src/test/run-pass/borrowck/two-phase-bin-ops.rs b/src/test/run-pass/borrowck/two-phase-bin-ops.rs index 5e1d436e31b..1242ae307d3 100644 --- a/src/test/run-pass/borrowck/two-phase-bin-ops.rs +++ b/src/test/run-pass/borrowck/two-phase-bin-ops.rs @@ -1,8 +1,4 @@ // run-pass -// revisions: lxl nll - -#![cfg_attr(nll, feature(nll))] - use std::ops::{AddAssign, SubAssign, MulAssign, DivAssign, RemAssign}; use std::ops::{BitAndAssign, BitOrAssign, BitXorAssign, ShlAssign, ShrAssign}; diff --git a/src/test/run-pass/issues/issue-24535-allow-mutable-borrow-in-match-guard.rs b/src/test/run-pass/issues/issue-24535-allow-mutable-borrow-in-match-guard.rs index 68f7dfd38f4..48362d0bb62 100644 --- a/src/test/run-pass/issues/issue-24535-allow-mutable-borrow-in-match-guard.rs +++ b/src/test/run-pass/issues/issue-24535-allow-mutable-borrow-in-match-guard.rs @@ -5,7 +5,6 @@ // See further discussion on rust-lang/rust#24535, // rust-lang/rfcs#1006, and rust-lang/rfcs#107 -#![feature(nll)] #![feature(bind_by_move_pattern_guards)] fn main() { diff --git a/src/test/run-pass/issues/issue-48962.rs b/src/test/run-pass/issues/issue-48962.rs index 7c644789834..80d815379be 100644 --- a/src/test/run-pass/issues/issue-48962.rs +++ b/src/test/run-pass/issues/issue-48962.rs @@ -1,7 +1,6 @@ // run-pass #![allow(unused_must_use)] // Test that we are able to reinitialize box with moved referent -#![feature(nll)] static mut ORDER: [usize; 3] = [0, 0, 0]; static mut INDEX: usize = 0; diff --git a/src/test/run-pass/issues/issue-51345.rs b/src/test/run-pass/issues/issue-51345.rs index 29a0a328503..15571e8bf5b 100644 --- a/src/test/run-pass/issues/issue-51345.rs +++ b/src/test/run-pass/issues/issue-51345.rs @@ -1,6 +1,5 @@ // run-pass #![allow(unreachable_code)] -#![feature(nll)] fn main() { let mut v = Vec::new(); diff --git a/src/test/run-pass/nll/issue-47153-generic-const.rs b/src/test/run-pass/nll/issue-47153-generic-const.rs index 4f021fda4e3..9f4d57111bb 100644 --- a/src/test/run-pass/nll/issue-47153-generic-const.rs +++ b/src/test/run-pass/nll/issue-47153-generic-const.rs @@ -3,7 +3,6 @@ // Regression test for #47153: constants in a generic context (such as // a trait) used to ICE. -#![feature(nll)] #![allow(warnings)] trait Foo { diff --git a/src/test/run-pass/nll/issue-47589.rs b/src/test/run-pass/nll/issue-47589.rs index 5bbed3a8590..280bf081138 100644 --- a/src/test/run-pass/nll/issue-47589.rs +++ b/src/test/run-pass/nll/issue-47589.rs @@ -1,7 +1,5 @@ // run-pass -#![feature(nll)] - pub struct DescriptorSet<'a> { pub slots: Vec> } diff --git a/src/test/run-pass/nll/issue-48623-closure.rs b/src/test/run-pass/nll/issue-48623-closure.rs index 5a41fff11a1..3f8587eed41 100644 --- a/src/test/run-pass/nll/issue-48623-closure.rs +++ b/src/test/run-pass/nll/issue-48623-closure.rs @@ -2,8 +2,6 @@ #![allow(path_statements)] #![allow(dead_code)] -#![feature(nll)] - struct WithDrop; impl Drop for WithDrop { diff --git a/src/test/run-pass/nll/issue-48623-generator.rs b/src/test/run-pass/nll/issue-48623-generator.rs index b404daca725..ba3eccff495 100644 --- a/src/test/run-pass/nll/issue-48623-generator.rs +++ b/src/test/run-pass/nll/issue-48623-generator.rs @@ -2,7 +2,6 @@ #![allow(path_statements)] #![allow(dead_code)] -#![feature(nll)] #![feature(generators, generator_trait)] struct WithDrop; diff --git a/src/test/run-pass/nll/issue-50343.rs b/src/test/run-pass/nll/issue-50343.rs index 8d2992b3b4f..55a2d231e19 100644 --- a/src/test/run-pass/nll/issue-50343.rs +++ b/src/test/run-pass/nll/issue-50343.rs @@ -1,6 +1,5 @@ // run-pass -#![feature(nll)] #![deny(unused_mut)] fn main() { diff --git a/src/test/run-pass/nll/issue-50461-used-mut-from-moves.rs b/src/test/run-pass/nll/issue-50461-used-mut-from-moves.rs index dc5257cfb92..69d7cdd83a6 100644 --- a/src/test/run-pass/nll/issue-50461-used-mut-from-moves.rs +++ b/src/test/run-pass/nll/issue-50461-used-mut-from-moves.rs @@ -1,6 +1,5 @@ // run-pass -#![feature(nll)] #![deny(unused_mut)] struct Foo { diff --git a/src/test/run-pass/nll/issue-53123-raw-pointer-cast.rs b/src/test/run-pass/nll/issue-53123-raw-pointer-cast.rs index c3f818812aa..941c9eeb411 100644 --- a/src/test/run-pass/nll/issue-53123-raw-pointer-cast.rs +++ b/src/test/run-pass/nll/issue-53123-raw-pointer-cast.rs @@ -1,6 +1,5 @@ // run-pass -#![feature(nll)] #![allow(unused_variables)] pub trait TryTransform { diff --git a/src/test/run-pass/nll/mutating_references.rs b/src/test/run-pass/nll/mutating_references.rs index 0af8751494e..eb46b30b6b9 100644 --- a/src/test/run-pass/nll/mutating_references.rs +++ b/src/test/run-pass/nll/mutating_references.rs @@ -1,7 +1,5 @@ // run-pass -#![feature(nll)] - struct List { value: T, next: Option>>, diff --git a/src/test/run-pass/nll/process_or_insert_default.rs b/src/test/run-pass/nll/process_or_insert_default.rs index e9cd4014bc3..84ac9bbd0dd 100644 --- a/src/test/run-pass/nll/process_or_insert_default.rs +++ b/src/test/run-pass/nll/process_or_insert_default.rs @@ -1,7 +1,5 @@ // run-pass -#![feature(nll)] - use std::collections::HashMap; fn process_or_insert_default(map: &mut HashMap, key: usize) { diff --git a/src/test/run-pass/nll/rc-loop.rs b/src/test/run-pass/nll/rc-loop.rs index a4ef546c25f..e59303d1f78 100644 --- a/src/test/run-pass/nll/rc-loop.rs +++ b/src/test/run-pass/nll/rc-loop.rs @@ -6,8 +6,6 @@ // `x`. The lexical checker makes this very painful. The NLL checker // does not. -#![feature(nll)] - use std::rc::Rc; #[derive(Debug, PartialEq, Eq)] diff --git a/src/test/ui/borrowck/borrowck-issue-48962.rs b/src/test/ui/borrowck/borrowck-issue-48962.rs index e7df319a0bb..86061c8cd6e 100644 --- a/src/test/ui/borrowck/borrowck-issue-48962.rs +++ b/src/test/ui/borrowck/borrowck-issue-48962.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct Node { elem: i32, next: Option>, diff --git a/src/test/ui/borrowck/borrowck-issue-48962.stderr b/src/test/ui/borrowck/borrowck-issue-48962.stderr index a5462b41396..ee174f6736e 100644 --- a/src/test/ui/borrowck/borrowck-issue-48962.stderr +++ b/src/test/ui/borrowck/borrowck-issue-48962.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `src` - --> $DIR/borrowck-issue-48962.rs:16:5 + --> $DIR/borrowck-issue-48962.rs:14:5 | LL | let mut src = &mut node; | ------- move occurs because `src` has type `&mut Node`, which does not implement the `Copy` trait @@ -9,7 +9,7 @@ LL | src.next = None; | ^^^^^^^^ value used here after move error[E0382]: use of moved value: `src` - --> $DIR/borrowck-issue-48962.rs:22:5 + --> $DIR/borrowck-issue-48962.rs:20:5 | LL | let mut src = &mut (22, 44); | ------- move occurs because `src` has type `&mut (i32, i32)`, which does not implement the `Copy` trait diff --git a/src/test/ui/borrowck/issue-10876.rs b/src/test/ui/borrowck/issue-10876.rs index d8fff5f1776..20ab905fec4 100644 --- a/src/test/ui/borrowck/issue-10876.rs +++ b/src/test/ui/borrowck/issue-10876.rs @@ -1,7 +1,5 @@ // run-pass -#![feature(nll)] - enum Nat { S(Box), Z diff --git a/src/test/ui/borrowck/issue-51348-multi-ref-mut-in-guard.rs b/src/test/ui/borrowck/issue-51348-multi-ref-mut-in-guard.rs index a8bfdbad38b..7d5acb95751 100644 --- a/src/test/ui/borrowck/issue-51348-multi-ref-mut-in-guard.rs +++ b/src/test/ui/borrowck/issue-51348-multi-ref-mut-in-guard.rs @@ -8,8 +8,6 @@ // run-pass -#![feature(nll)] - fn foo(x: &mut Result<(u32, u32), (u32, u32)>) -> u32 { match *x { Ok((ref mut v, _)) | Err((_, ref mut v)) if *v > 0 => { *v } diff --git a/src/test/ui/borrowck/issue-52713-bug.rs b/src/test/ui/borrowck/issue-52713-bug.rs index 460e6b4bbae..671e83dfadc 100644 --- a/src/test/ui/borrowck/issue-52713-bug.rs +++ b/src/test/ui/borrowck/issue-52713-bug.rs @@ -2,8 +2,6 @@ // computing liveness that wound up accidentally causing the program // below to be accepted. -#![feature(nll)] - fn foo<'a>(x: &'a mut u32) -> u32 { let mut x = 22; let y = &x; diff --git a/src/test/ui/borrowck/issue-52713-bug.stderr b/src/test/ui/borrowck/issue-52713-bug.stderr index e3216f5d33f..4abb6fb2c71 100644 --- a/src/test/ui/borrowck/issue-52713-bug.stderr +++ b/src/test/ui/borrowck/issue-52713-bug.stderr @@ -1,5 +1,5 @@ error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/issue-52713-bug.rs:14:5 + --> $DIR/issue-52713-bug.rs:12:5 | LL | let y = &x; | -- borrow of `x` occurs here diff --git a/src/test/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.rs b/src/test/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.rs index ad4accbbeee..51df40016d8 100644 --- a/src/test/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.rs +++ b/src/test/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - #![allow(dead_code)] #[derive(Debug)] diff --git a/src/test/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.stderr b/src/test/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.stderr index 6a12016b2a5..519f1d6fb27 100644 --- a/src/test/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.stderr +++ b/src/test/ui/borrowck/issue-54597-reject-move-out-of-borrow-via-pat.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of borrowed content - --> $DIR/issue-54597-reject-move-out-of-borrow-via-pat.rs:16:13 + --> $DIR/issue-54597-reject-move-out-of-borrow-via-pat.rs:14:13 | LL | *array | ^^^^^^ diff --git a/src/test/ui/borrowck/issue-58776-borrowck-scans-children.rs b/src/test/ui/borrowck/issue-58776-borrowck-scans-children.rs index 0f3f1a639f7..efa313a9d23 100644 --- a/src/test/ui/borrowck/issue-58776-borrowck-scans-children.rs +++ b/src/test/ui/borrowck/issue-58776-borrowck-scans-children.rs @@ -1,19 +1,11 @@ -// ignore-compare-mode-nll - -// revisions: migrate nll - -#![cfg_attr(nll, feature(nll))] - fn main() { let mut greeting = "Hello world!".to_string(); let res = (|| (|| &greeting)())(); greeting = "DEALLOCATED".to_string(); - //[migrate]~^ ERROR cannot assign - //[nll]~^^ ERROR cannot assign + //~^ ERROR cannot assign drop(greeting); - //[migrate]~^ ERROR cannot move - //[nll]~^^ ERROR cannot move + //~^ ERROR cannot move println!("thread result: {:?}", res); } diff --git a/src/test/ui/borrowck/issue-58776-borrowck-scans-children.nll.stderr b/src/test/ui/borrowck/issue-58776-borrowck-scans-children.stderr similarity index 91% rename from src/test/ui/borrowck/issue-58776-borrowck-scans-children.nll.stderr rename to src/test/ui/borrowck/issue-58776-borrowck-scans-children.stderr index efd4e1a1716..9b1d6fa7d35 100644 --- a/src/test/ui/borrowck/issue-58776-borrowck-scans-children.nll.stderr +++ b/src/test/ui/borrowck/issue-58776-borrowck-scans-children.stderr @@ -1,5 +1,5 @@ error[E0506]: cannot assign to `greeting` because it is borrowed - --> $DIR/issue-58776-borrowck-scans-children.rs:11:5 + --> $DIR/issue-58776-borrowck-scans-children.rs:5:5 | LL | let res = (|| (|| &greeting)())(); | -- -------- borrow occurs due to use in closure @@ -13,7 +13,7 @@ LL | println!("thread result: {:?}", res); | --- borrow later used here error[E0505]: cannot move out of `greeting` because it is borrowed - --> $DIR/issue-58776-borrowck-scans-children.rs:14:10 + --> $DIR/issue-58776-borrowck-scans-children.rs:7:10 | LL | let res = (|| (|| &greeting)())(); | -- -------- borrow occurs due to use in closure diff --git a/src/test/ui/borrowck/two-phase-across-loop.rs b/src/test/ui/borrowck/two-phase-across-loop.rs index b1a4c54f49b..12222342c95 100644 --- a/src/test/ui/borrowck/two-phase-across-loop.rs +++ b/src/test/ui/borrowck/two-phase-across-loop.rs @@ -1,8 +1,6 @@ // Test that a borrow which starts as a 2-phase borrow and gets // carried around a loop winds up conflicting with itself. -#![feature(nll)] - struct Foo { x: String } impl Foo { diff --git a/src/test/ui/borrowck/two-phase-across-loop.stderr b/src/test/ui/borrowck/two-phase-across-loop.stderr index 933d3eb7111..38993a50bf6 100644 --- a/src/test/ui/borrowck/two-phase-across-loop.stderr +++ b/src/test/ui/borrowck/two-phase-across-loop.stderr @@ -1,5 +1,5 @@ error[E0499]: cannot borrow `foo` as mutable more than once at a time - --> $DIR/two-phase-across-loop.rs:19:22 + --> $DIR/two-phase-across-loop.rs:17:22 | LL | strings.push(foo.get_string()); | ^^^ mutable borrow starts here in previous iteration of loop diff --git a/src/test/ui/borrowck/two-phase-multi-mut.rs b/src/test/ui/borrowck/two-phase-multi-mut.rs index ed3d257da9f..bb646d7caf1 100644 --- a/src/test/ui/borrowck/two-phase-multi-mut.rs +++ b/src/test/ui/borrowck/two-phase-multi-mut.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct Foo { } diff --git a/src/test/ui/borrowck/two-phase-multi-mut.stderr b/src/test/ui/borrowck/two-phase-multi-mut.stderr index c4168503e4c..33fa4a3a150 100644 --- a/src/test/ui/borrowck/two-phase-multi-mut.stderr +++ b/src/test/ui/borrowck/two-phase-multi-mut.stderr @@ -1,5 +1,5 @@ error[E0499]: cannot borrow `foo` as mutable more than once at a time - --> $DIR/two-phase-multi-mut.rs:13:5 + --> $DIR/two-phase-multi-mut.rs:11:5 | LL | foo.method(&mut foo); | ^^^^------^--------^ @@ -9,7 +9,7 @@ LL | foo.method(&mut foo); | second mutable borrow occurs here error[E0499]: cannot borrow `foo` as mutable more than once at a time - --> $DIR/two-phase-multi-mut.rs:13:16 + --> $DIR/two-phase-multi-mut.rs:11:16 | LL | foo.method(&mut foo); | --- ------ ^^^^^^^^ second mutable borrow occurs here diff --git a/src/test/ui/c-variadic/variadic-ffi-5.rs b/src/test/ui/c-variadic/variadic-ffi-5.rs deleted file mode 100644 index fcc80d9b0cc..00000000000 --- a/src/test/ui/c-variadic/variadic-ffi-5.rs +++ /dev/null @@ -1,31 +0,0 @@ -#![crate_type="lib"] -#![no_std] -#![feature(c_variadic)] -// The tests in this file are similar to that of variadic-ffi-4, but this -// one enables nll. -#![feature(nll)] - -use core::ffi::VaList; - -pub unsafe extern "C" fn no_escape0<'a>(_: usize, ap: ...) -> VaList<'a> { - ap //~ ERROR: explicit lifetime required -} - -pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaList<'static> { - ap //~ ERROR: explicit lifetime required -} - -pub unsafe extern "C" fn no_escape2(_: usize, ap: ...) { - let _ = ap.with_copy(|ap| { ap }); //~ ERROR: lifetime may not live long enough -} - -pub unsafe extern "C" fn no_escape3(_: usize, ap0: &mut VaList, mut ap1: ...) { - *ap0 = ap1; //~ ERROR: lifetime may not live long enough -} - -pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaList, mut ap1: ...) { - ap0 = &mut ap1; - //~^ ERROR: lifetime may not live long enough - //~^^ ERROR: lifetime may not live long enough - //~^^^ ERROR: `ap1` does not live long enough -} diff --git a/src/test/ui/c-variadic/variadic-ffi-5.stderr b/src/test/ui/c-variadic/variadic-ffi-5.stderr deleted file mode 100644 index 27421010a97..00000000000 --- a/src/test/ui/c-variadic/variadic-ffi-5.stderr +++ /dev/null @@ -1,73 +0,0 @@ -error[E0621]: explicit lifetime required in the type of `ap` - --> $DIR/variadic-ffi-5.rs:11:5 - | -LL | pub unsafe extern "C" fn no_escape0<'a>(_: usize, ap: ...) -> VaList<'a> { - | --- help: add explicit lifetime `'a` to the type of `ap`: `core::ffi::VaList<'a>` -LL | ap - | ^^ lifetime `'a` required - -error[E0621]: explicit lifetime required in the type of `ap` - --> $DIR/variadic-ffi-5.rs:15:5 - | -LL | pub unsafe extern "C" fn no_escape1(_: usize, ap: ...) -> VaList<'static> { - | --- help: add explicit lifetime `'static` to the type of `ap`: `core::ffi::VaList<'static>` -LL | ap - | ^^ lifetime `'static` required - -error: lifetime may not live long enough - --> $DIR/variadic-ffi-5.rs:19:33 - | -LL | let _ = ap.with_copy(|ap| { ap }); - | --- ^^ returning this value requires that `'1` must outlive `'2` - | | | - | | return type of closure is core::ffi::VaList<'2> - | has type `core::ffi::VaList<'1>` - -error: lifetime may not live long enough - --> $DIR/variadic-ffi-5.rs:23:5 - | -LL | pub unsafe extern "C" fn no_escape3(_: usize, ap0: &mut VaList, mut ap1: ...) { - | --- ------- has type `core::ffi::VaList<'1>` - | | - | has type `&mut core::ffi::VaList<'2>` -LL | *ap0 = ap1; - | ^^^^^^^^^^ assignment requires that `'1` must outlive `'2` - -error: lifetime may not live long enough - --> $DIR/variadic-ffi-5.rs:27:5 - | -LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaList, mut ap1: ...) { - | ------- ------- has type `core::ffi::VaList<'2>` - | | - | has type `&mut core::ffi::VaList<'1>` -LL | ap0 = &mut ap1; - | ^^^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2` - -error: lifetime may not live long enough - --> $DIR/variadic-ffi-5.rs:27:5 - | -LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaList, mut ap1: ...) { - | ------- ------- has type `core::ffi::VaList<'1>` - | | - | has type `&mut core::ffi::VaList<'2>` -LL | ap0 = &mut ap1; - | ^^^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2` - -error[E0597]: `ap1` does not live long enough - --> $DIR/variadic-ffi-5.rs:27:11 - | -LL | pub unsafe extern "C" fn no_escape4(_: usize, mut ap0: &mut VaList, mut ap1: ...) { - | - let's call the lifetime of this reference `'1` -LL | ap0 = &mut ap1; - | ------^^^^^^^^ - | | | - | | borrowed value does not live long enough - | assignment requires that `ap1` is borrowed for `'1` -... -LL | } - | - `ap1` dropped here while still borrowed - -error: aborting due to 7 previous errors - -Some errors have detailed explanations: E0597, E0621. -For more information about an error, try `rustc --explain E0597`. diff --git a/src/test/ui/consts/const-eval/promote_mutable_zst_mir_borrowck.rs b/src/test/ui/consts/const-eval/promote_mutable_zst_mir_borrowck.rs index 06b1727258d..34f61ed5a34 100644 --- a/src/test/ui/consts/const-eval/promote_mutable_zst_mir_borrowck.rs +++ b/src/test/ui/consts/const-eval/promote_mutable_zst_mir_borrowck.rs @@ -1,7 +1,5 @@ // compile-pass -#![feature(nll)] - pub fn main() { let y: &'static mut [u8; 0] = &mut []; } diff --git a/src/test/ui/consts/issue-54224.rs b/src/test/ui/consts/issue-54224.rs index b5a8fe8819c..f1947933d67 100644 --- a/src/test/ui/consts/issue-54224.rs +++ b/src/test/ui/consts/issue-54224.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - const FOO: Option<&[[u8; 3]]> = Some(&[*b"foo"]); //~ ERROR temporary value dropped while borrowed use std::borrow::Cow; diff --git a/src/test/ui/consts/issue-54224.stderr b/src/test/ui/consts/issue-54224.stderr index 9b6638b228e..8dcb4daca3b 100644 --- a/src/test/ui/consts/issue-54224.stderr +++ b/src/test/ui/consts/issue-54224.stderr @@ -1,5 +1,5 @@ error[E0716]: temporary value dropped while borrowed - --> $DIR/issue-54224.rs:3:39 + --> $DIR/issue-54224.rs:1:39 | LL | const FOO: Option<&[[u8; 3]]> = Some(&[*b"foo"]); | ------^^^^^^^^^- @@ -9,7 +9,7 @@ LL | const FOO: Option<&[[u8; 3]]> = Some(&[*b"foo"]); | using this value as a constant requires that borrow lasts for `'static` error[E0716]: temporary value dropped while borrowed - --> $DIR/issue-54224.rs:11:57 + --> $DIR/issue-54224.rs:9:57 | LL | pub const Z: Cow<'static, [ [u8; 3] ]> = Cow::Borrowed(&[*b"ABC"]); | ---------------^^^^^^^^^- diff --git a/src/test/ui/consts/promote_evaluation_unused_result.rs b/src/test/ui/consts/promote_evaluation_unused_result.rs index d199e34775e..dc21b9fe8cd 100644 --- a/src/test/ui/consts/promote_evaluation_unused_result.rs +++ b/src/test/ui/consts/promote_evaluation_unused_result.rs @@ -1,7 +1,5 @@ //compile-pass -#![feature(nll)] - fn main() { let _: &'static usize = &(loop {}, 1).1; diff --git a/src/test/ui/consts/promote_fn_calls.rs b/src/test/ui/consts/promote_fn_calls.rs index 045322de347..6b6eea36361 100644 --- a/src/test/ui/consts/promote_fn_calls.rs +++ b/src/test/ui/consts/promote_fn_calls.rs @@ -1,8 +1,6 @@ // compile-pass // aux-build:promotable_const_fn_lib.rs -#![feature(nll)] - extern crate promotable_const_fn_lib; use promotable_const_fn_lib::{foo, Foo}; diff --git a/src/test/ui/consts/promote_fn_calls_std.rs b/src/test/ui/consts/promote_fn_calls_std.rs index 0350708d673..d982f350208 100644 --- a/src/test/ui/consts/promote_fn_calls_std.rs +++ b/src/test/ui/consts/promote_fn_calls_std.rs @@ -1,7 +1,5 @@ // compile-pass -#![feature(nll)] - fn main() { let x: &'static u8 = &u8::max_value(); let x: &'static u16 = &u16::max_value(); diff --git a/src/test/ui/generator/generator-region-requirements.rs b/src/test/ui/generator/generator-region-requirements.rs index cd9abaae056..41cb339f459 100644 --- a/src/test/ui/generator/generator-region-requirements.rs +++ b/src/test/ui/generator/generator-region-requirements.rs @@ -1,8 +1,4 @@ -// revisions: migrate nll -// ignore-compare-mode-nll - #![feature(generators, generator_trait)] -#![cfg_attr(nll, feature(nll))] use std::ops::{Generator, GeneratorState}; use std::pin::Pin; @@ -14,8 +10,7 @@ fn dangle(x: &mut i32) -> &'static mut i32 { loop { match Pin::new(&mut g).resume() { GeneratorState::Complete(c) => return c, -//[nll]~^ ERROR explicit lifetime required -//[migrate]~^^ ERROR explicit lifetime required + //~^ ERROR explicit lifetime required GeneratorState::Yielded(_) => (), } } diff --git a/src/test/ui/generator/generator-region-requirements.nll.stderr b/src/test/ui/generator/generator-region-requirements.stderr similarity index 90% rename from src/test/ui/generator/generator-region-requirements.nll.stderr rename to src/test/ui/generator/generator-region-requirements.stderr index 8a96d187f6b..53d48bc4f56 100644 --- a/src/test/ui/generator/generator-region-requirements.nll.stderr +++ b/src/test/ui/generator/generator-region-requirements.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `x` - --> $DIR/generator-region-requirements.rs:16:51 + --> $DIR/generator-region-requirements.rs:12:51 | LL | fn dangle(x: &mut i32) -> &'static mut i32 { | -------- help: add explicit lifetime `'static` to the type of `x`: `&'static mut i32` diff --git a/src/test/ui/generator/generator-with-nll.rs b/src/test/ui/generator/generator-with-nll.rs index 87afa57ab51..cee3e6d226c 100644 --- a/src/test/ui/generator/generator-with-nll.rs +++ b/src/test/ui/generator/generator-with-nll.rs @@ -1,5 +1,4 @@ #![feature(generators)] -#![feature(nll)] fn main() { || { diff --git a/src/test/ui/generator/generator-with-nll.stderr b/src/test/ui/generator/generator-with-nll.stderr index bd5abb20206..14199aeb930 100644 --- a/src/test/ui/generator/generator-with-nll.stderr +++ b/src/test/ui/generator/generator-with-nll.stderr @@ -1,5 +1,5 @@ error[E0626]: borrow may still be in use when generator yields - --> $DIR/generator-with-nll.rs:8:17 + --> $DIR/generator-with-nll.rs:7:17 | LL | let b = &mut true; | ^^^^^^^^^ diff --git a/src/test/ui/impl-trait/closure-calling-parent-fn.rs b/src/test/ui/impl-trait/closure-calling-parent-fn.rs index cb5f78bd6fc..58d7875ccd0 100644 --- a/src/test/ui/impl-trait/closure-calling-parent-fn.rs +++ b/src/test/ui/impl-trait/closure-calling-parent-fn.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // Regression test for #54593: the MIR type checker was going wrong // when a closure returns the `impl Copy` from its parent fn. It was // (incorrectly) replacing the `impl Copy` in its return type with the diff --git a/src/test/ui/impl-trait/region-escape-via-bound-contravariant-closure.rs b/src/test/ui/impl-trait/region-escape-via-bound-contravariant-closure.rs index cb40d90ae55..adaa474474f 100644 --- a/src/test/ui/impl-trait/region-escape-via-bound-contravariant-closure.rs +++ b/src/test/ui/impl-trait/region-escape-via-bound-contravariant-closure.rs @@ -9,7 +9,6 @@ #![allow(dead_code)] #![feature(in_band_lifetimes)] -#![feature(nll)] fn foo(x: &'x u32) -> impl Fn() -> &'y u32 where 'x: 'y diff --git a/src/test/ui/impl-trait/region-escape-via-bound-contravariant.rs b/src/test/ui/impl-trait/region-escape-via-bound-contravariant.rs index e2310a3907f..204c2ff3041 100644 --- a/src/test/ui/impl-trait/region-escape-via-bound-contravariant.rs +++ b/src/test/ui/impl-trait/region-escape-via-bound-contravariant.rs @@ -9,7 +9,6 @@ #![allow(dead_code)] #![feature(in_band_lifetimes)] -#![feature(nll)] trait Trait<'a> { } diff --git a/src/test/ui/impl-trait/region-escape-via-bound.rs b/src/test/ui/impl-trait/region-escape-via-bound.rs index d62aec800e8..29243699e44 100644 --- a/src/test/ui/impl-trait/region-escape-via-bound.rs +++ b/src/test/ui/impl-trait/region-escape-via-bound.rs @@ -5,7 +5,6 @@ #![allow(dead_code)] #![feature(in_band_lifetimes)] -#![feature(nll)] use std::cell::Cell; diff --git a/src/test/ui/impl-trait/region-escape-via-bound.stderr b/src/test/ui/impl-trait/region-escape-via-bound.stderr index 81b44b7eba7..5c8e322f712 100644 --- a/src/test/ui/impl-trait/region-escape-via-bound.stderr +++ b/src/test/ui/impl-trait/region-escape-via-bound.stderr @@ -1,11 +1,11 @@ error[E0700]: hidden type for `impl Trait` captures lifetime that does not appear in bounds - --> $DIR/region-escape-via-bound.rs:16:29 + --> $DIR/region-escape-via-bound.rs:15:29 | LL | fn foo(x: Cell<&'x u32>) -> impl Trait<'y> | ^^^^^^^^^^^^^^ | -note: hidden type `std::cell::Cell<&'x u32>` captures the lifetime 'x as defined on the function body at 18:7 - --> $DIR/region-escape-via-bound.rs:18:7 +note: hidden type `std::cell::Cell<&'x u32>` captures the lifetime 'x as defined on the function body at 17:7 + --> $DIR/region-escape-via-bound.rs:17:7 | LL | where 'x: 'y | ^^ diff --git a/src/test/ui/issues/issue-34721.rs b/src/test/ui/issues/issue-34721.rs index 226c21446b1..bdc9fe43a8b 100644 --- a/src/test/ui/issues/issue-34721.rs +++ b/src/test/ui/issues/issue-34721.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - pub trait Foo { fn zero(self) -> Self; } diff --git a/src/test/ui/issues/issue-34721.stderr b/src/test/ui/issues/issue-34721.stderr index 2ed7b543e71..d5cede990a3 100644 --- a/src/test/ui/issues/issue-34721.stderr +++ b/src/test/ui/issues/issue-34721.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `x` - --> $DIR/issue-34721.rs:27:9 + --> $DIR/issue-34721.rs:25:9 | LL | pub fn baz(x: T) -> T { | - - move occurs because `x` has type `T`, which does not implement the `Copy` trait diff --git a/src/test/ui/issues/issue-45696-no-variant-box-recur.rs b/src/test/ui/issues/issue-45696-no-variant-box-recur.rs index b5d9036aba6..c688261fa1c 100644 --- a/src/test/ui/issues/issue-45696-no-variant-box-recur.rs +++ b/src/test/ui/issues/issue-45696-no-variant-box-recur.rs @@ -6,11 +6,6 @@ // We will explicitly test NLL, and migration modes; thus we will also skip the // automated compare-mode=nll. -// revisions: nll migrate -// ignore-compare-mode-nll - -#![cfg_attr(nll, feature(nll))] - // run-pass // This test has structs and functions that are by definition unusable diff --git a/src/test/ui/issues/issue-46036.rs b/src/test/ui/issues/issue-46036.rs index c517bbe57e8..18af33c1821 100644 --- a/src/test/ui/issues/issue-46036.rs +++ b/src/test/ui/issues/issue-46036.rs @@ -1,6 +1,5 @@ // Issue 46036: [NLL] false edges on infinite loops // Infinite loops should create false edges to the cleanup block. -#![feature(nll)] struct Foo { x: &'static u32 } diff --git a/src/test/ui/issues/issue-46036.stderr b/src/test/ui/issues/issue-46036.stderr index 9c1746e0fa1..49dd0e267b8 100644 --- a/src/test/ui/issues/issue-46036.stderr +++ b/src/test/ui/issues/issue-46036.stderr @@ -1,5 +1,5 @@ error[E0597]: `a` does not live long enough - --> $DIR/issue-46036.rs:9:24 + --> $DIR/issue-46036.rs:8:24 | LL | let foo = Foo { x: &a }; | ^^ diff --git a/src/test/ui/issues/issue-46983.rs b/src/test/ui/issues/issue-46983.rs index a5c1e17a58c..c1fd7729bde 100644 --- a/src/test/ui/issues/issue-46983.rs +++ b/src/test/ui/issues/issue-46983.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn foo(x: &u32) -> &'static u32 { &*x //~^ ERROR explicit lifetime required in the type of `x` [E0621] diff --git a/src/test/ui/issues/issue-46983.stderr b/src/test/ui/issues/issue-46983.stderr index 43d351ec905..8a4a6bdb39f 100644 --- a/src/test/ui/issues/issue-46983.stderr +++ b/src/test/ui/issues/issue-46983.stderr @@ -1,5 +1,5 @@ error[E0621]: explicit lifetime required in the type of `x` - --> $DIR/issue-46983.rs:4:5 + --> $DIR/issue-46983.rs:2:5 | LL | fn foo(x: &u32) -> &'static u32 { | ---- help: add explicit lifetime `'static` to the type of `x`: `&'static u32` diff --git a/src/test/ui/issues/issue-47184.rs b/src/test/ui/issues/issue-47184.rs index 04f1146a8f8..2f78ce0002b 100644 --- a/src/test/ui/issues/issue-47184.rs +++ b/src/test/ui/issues/issue-47184.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn main() { let _vec: Vec<&'static String> = vec![&String::new()]; //~^ ERROR temporary value dropped while borrowed [E0716] diff --git a/src/test/ui/issues/issue-47184.stderr b/src/test/ui/issues/issue-47184.stderr index 2b4d576e726..f97713b4ac4 100644 --- a/src/test/ui/issues/issue-47184.stderr +++ b/src/test/ui/issues/issue-47184.stderr @@ -1,5 +1,5 @@ error[E0716]: temporary value dropped while borrowed - --> $DIR/issue-47184.rs:4:44 + --> $DIR/issue-47184.rs:2:44 | LL | let _vec: Vec<&'static String> = vec![&String::new()]; | -------------------- ^^^^^^^^^^^^^ - temporary value is freed at the end of this statement diff --git a/src/test/ui/issues/issue-47646.rs b/src/test/ui/issues/issue-47646.rs index c3c07bf6411..ace6cdce841 100644 --- a/src/test/ui/issues/issue-47646.rs +++ b/src/test/ui/issues/issue-47646.rs @@ -1,6 +1,3 @@ -#![allow(warnings)] -#![feature(nll)] - use std::collections::BinaryHeap; fn main() { diff --git a/src/test/ui/issues/issue-47646.stderr b/src/test/ui/issues/issue-47646.stderr index db9f227d6b7..c0b87636848 100644 --- a/src/test/ui/issues/issue-47646.stderr +++ b/src/test/ui/issues/issue-47646.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `heap` as immutable because it is also borrowed as mutable - --> $DIR/issue-47646.rs:12:30 + --> $DIR/issue-47646.rs:9:30 | LL | let borrow = heap.peek_mut(); | ---- mutable borrow occurs here diff --git a/src/test/ui/issues/issue-47703-1.rs b/src/test/ui/issues/issue-47703-1.rs index 9add314fdaf..74323317f19 100644 --- a/src/test/ui/issues/issue-47703-1.rs +++ b/src/test/ui/issues/issue-47703-1.rs @@ -1,6 +1,4 @@ // compile-pass -#![allow(dead_code)] -#![feature(nll)] struct AtomicRefMut<'a> { value: &'a mut i32, diff --git a/src/test/ui/issues/issue-47703-tuple.rs b/src/test/ui/issues/issue-47703-tuple.rs index 850771cffd0..377eeb67ae1 100644 --- a/src/test/ui/issues/issue-47703-tuple.rs +++ b/src/test/ui/issues/issue-47703-tuple.rs @@ -1,6 +1,4 @@ // compile-pass -#![allow(dead_code)] -#![feature(nll)] struct WithDrop; diff --git a/src/test/ui/issues/issue-47703.rs b/src/test/ui/issues/issue-47703.rs index 06b17e931a9..22f2a1f364d 100644 --- a/src/test/ui/issues/issue-47703.rs +++ b/src/test/ui/issues/issue-47703.rs @@ -1,6 +1,4 @@ // compile-pass -#![allow(dead_code)] -#![feature(nll)] struct MyStruct<'a> { field: &'a mut (), diff --git a/src/test/ui/issues/issue-47722.rs b/src/test/ui/issues/issue-47722.rs index c9bc6147aa9..cefc872668c 100644 --- a/src/test/ui/issues/issue-47722.rs +++ b/src/test/ui/issues/issue-47722.rs @@ -1,10 +1,8 @@ // compile-pass -#![allow(dead_code)] // Tests that automatic coercions from &mut T to *mut T // allow borrows of T to expire immediately - essentially, that // they work identically to 'foo as *mut T' -#![feature(nll)] struct SelfReference { self_reference: *mut SelfReference, diff --git a/src/test/ui/issues/issue-47789.rs b/src/test/ui/issues/issue-47789.rs index d15a27a2a2e..334bd608add 100644 --- a/src/test/ui/issues/issue-47789.rs +++ b/src/test/ui/issues/issue-47789.rs @@ -1,9 +1,6 @@ // compile-pass -#![allow(dead_code)] #![allow(non_upper_case_globals)] -#![feature(nll)] - static mut x: &'static u32 = &0; fn foo() { diff --git a/src/test/ui/issues/issue-48132.rs b/src/test/ui/issues/issue-48132.rs index b3cef78f3e6..ea325ea695f 100644 --- a/src/test/ui/issues/issue-48132.rs +++ b/src/test/ui/issues/issue-48132.rs @@ -3,9 +3,6 @@ // run-pass -#![feature(nll)] -#![allow(warnings)] - struct Inner { iterator: I, item: V, diff --git a/src/test/ui/issues/issue-48179.rs b/src/test/ui/issues/issue-48179.rs index 245f13b2b60..90e9858d741 100644 --- a/src/test/ui/issues/issue-48179.rs +++ b/src/test/ui/issues/issue-48179.rs @@ -3,9 +3,6 @@ // run-pass -#![feature(nll)] -#![allow(warnings)] - pub struct Container { value: Option, } diff --git a/src/test/ui/issues/issue-48803.rs b/src/test/ui/issues/issue-48803.rs index bc1bc29c98f..f7fd04179f2 100644 --- a/src/test/ui/issues/issue-48803.rs +++ b/src/test/ui/issues/issue-48803.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn flatten<'a, 'b, T>(x: &'a &'b T) -> &'a T { x } diff --git a/src/test/ui/issues/issue-48803.stderr b/src/test/ui/issues/issue-48803.stderr index 9a6da9e625d..2f94039c0c3 100644 --- a/src/test/ui/issues/issue-48803.stderr +++ b/src/test/ui/issues/issue-48803.stderr @@ -1,5 +1,5 @@ error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/issue-48803.rs:12:5 + --> $DIR/issue-48803.rs:10:5 | LL | let y = &x; | -- borrow of `x` occurs here diff --git a/src/test/ui/issues/issue-49579.rs b/src/test/ui/issues/issue-49579.rs index 34f277af01e..dd7b9eeb8d5 100644 --- a/src/test/ui/issues/issue-49579.rs +++ b/src/test/ui/issues/issue-49579.rs @@ -1,8 +1,6 @@ // compile-pass // ignore-emscripten no i128 support -#![feature(nll)] - fn fibs(n: u32) -> impl Iterator { (0 .. n) .scan((0, 1), |st, _| { diff --git a/src/test/ui/issues/issue-51515.rs b/src/test/ui/issues/issue-51515.rs index 64d9822bab4..8eab7b2fa3a 100644 --- a/src/test/ui/issues/issue-51515.rs +++ b/src/test/ui/issues/issue-51515.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn main() { let foo = &16; //~^ HELP consider changing this to be a mutable reference diff --git a/src/test/ui/issues/issue-51515.stderr b/src/test/ui/issues/issue-51515.stderr index 0e6c8fd48f1..827bb8fe2b8 100644 --- a/src/test/ui/issues/issue-51515.stderr +++ b/src/test/ui/issues/issue-51515.stderr @@ -1,5 +1,5 @@ error[E0594]: cannot assign to `*foo` which is behind a `&` reference - --> $DIR/issue-51515.rs:7:5 + --> $DIR/issue-51515.rs:5:5 | LL | let foo = &16; | --- help: consider changing this to be a mutable reference: `&mut 16` @@ -8,7 +8,7 @@ LL | *foo = 32; | ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written error[E0594]: cannot assign to `*bar` which is behind a `&` reference - --> $DIR/issue-51515.rs:12:5 + --> $DIR/issue-51515.rs:10:5 | LL | let bar = foo; | --- help: consider changing this to be a mutable reference: `&mut i32` diff --git a/src/test/ui/issues/issue-52057.rs b/src/test/ui/issues/issue-52057.rs index 356efd5dfed..911983445e6 100644 --- a/src/test/ui/issues/issue-52057.rs +++ b/src/test/ui/issues/issue-52057.rs @@ -4,8 +4,6 @@ // // run-pass -#![feature(nll)] - pub trait Parser { type Input; diff --git a/src/test/ui/issues/issue-52992.rs b/src/test/ui/issues/issue-52992.rs index 0fdf077d2fc..c58656330e1 100644 --- a/src/test/ui/issues/issue-52992.rs +++ b/src/test/ui/issues/issue-52992.rs @@ -4,8 +4,6 @@ // // compile-pass -#![feature(nll)] - fn main() {} fn fail<'a>() -> Struct<'a, Generic<()>> { diff --git a/src/test/ui/issues/issue-53568.rs b/src/test/ui/issues/issue-53568.rs index f04d861250b..4d3b3f80a97 100644 --- a/src/test/ui/issues/issue-53568.rs +++ b/src/test/ui/issues/issue-53568.rs @@ -3,9 +3,6 @@ // // compile-pass -#![feature(nll)] -#![allow(dead_code)] - trait Future { type Item; } diff --git a/src/test/ui/issues/issue-54943-1.rs b/src/test/ui/issues/issue-54943-1.rs index 7750e340361..8d3a4e72de4 100644 --- a/src/test/ui/issues/issue-54943-1.rs +++ b/src/test/ui/issues/issue-54943-1.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // This test is a minimal version of an ICE in the dropck-eyepatch tests // found in the fix for #54943. diff --git a/src/test/ui/issues/issue-54943-2.rs b/src/test/ui/issues/issue-54943-2.rs index f829c38c35d..41ca7c14982 100644 --- a/src/test/ui/issues/issue-54943-2.rs +++ b/src/test/ui/issues/issue-54943-2.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // This test is a minimal version of an ICE in the dropck-eyepatch tests // found in the fix for #54943. In particular, this test is in unreachable // code as the initial fix for this ICE only worked if the code was reachable. diff --git a/src/test/ui/issues/issue-54943.nll.stderr b/src/test/ui/issues/issue-54943.nll.stderr new file mode 100644 index 00000000000..59be0f983b9 --- /dev/null +++ b/src/test/ui/issues/issue-54943.nll.stderr @@ -0,0 +1,11 @@ +error: lifetime may not live long enough + --> $DIR/issue-54943.rs:6:13 + | +LL | fn boo<'a>() { + | -- lifetime `'a` defined here +... +LL | let x = foo::<&'a u32>(); + | ^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` + +error: aborting due to previous error + diff --git a/src/test/ui/issues/issue-54943.rs b/src/test/ui/issues/issue-54943.rs index ce4e0106743..85722300bf0 100644 --- a/src/test/ui/issues/issue-54943.rs +++ b/src/test/ui/issues/issue-54943.rs @@ -1,13 +1,10 @@ -#![feature(nll)] -#![allow(warnings)] - fn foo() { } fn boo<'a>() { return; let x = foo::<&'a u32>(); - //~^ ERROR lifetime may not live long enough + //~^ ERROR } fn main() {} diff --git a/src/test/ui/issues/issue-54943.stderr b/src/test/ui/issues/issue-54943.stderr index aa68177bcdb..d0f03f90c83 100644 --- a/src/test/ui/issues/issue-54943.stderr +++ b/src/test/ui/issues/issue-54943.stderr @@ -1,11 +1,10 @@ -error: lifetime may not live long enough - --> $DIR/issue-54943.rs:9:13 +error[E0477]: the type `&'a u32` does not fulfill the required lifetime + --> $DIR/issue-54943.rs:6:13 | -LL | fn boo<'a>() { - | -- lifetime `'a` defined here -... LL | let x = foo::<&'a u32>(); - | ^^^^^^^^^^^^^^ requires that `'a` must outlive `'static` + | ^^^^^^^^^^^^^^ + | + = note: type must satisfy the static lifetime error: aborting due to previous error diff --git a/src/test/ui/mir-dataflow/def-inits-1.rs b/src/test/ui/mir-dataflow/def-inits-1.rs index 07ac1900bc7..91d41e9b579 100644 --- a/src/test/ui/mir-dataflow/def-inits-1.rs +++ b/src/test/ui/mir-dataflow/def-inits-1.rs @@ -1,6 +1,5 @@ // General test of maybe_uninits state computed by MIR dataflow. -#![feature(nll)] #![feature(core_intrinsics, rustc_attrs)] use std::intrinsics::rustc_peek; diff --git a/src/test/ui/mir-dataflow/def-inits-1.stderr b/src/test/ui/mir-dataflow/def-inits-1.stderr index 6bc5f7dcb99..48d84504894 100644 --- a/src/test/ui/mir-dataflow/def-inits-1.stderr +++ b/src/test/ui/mir-dataflow/def-inits-1.stderr @@ -1,23 +1,23 @@ error: rustc_peek: bit not set - --> $DIR/def-inits-1.rs:15:14 + --> $DIR/def-inits-1.rs:14:14 | LL | unsafe { rustc_peek(&ret); } | ^^^^^^^^^^^^^^^^ error: rustc_peek: bit not set - --> $DIR/def-inits-1.rs:31:14 + --> $DIR/def-inits-1.rs:30:14 | LL | unsafe { rustc_peek(&z); } | ^^^^^^^^^^^^^^ error: rustc_peek: bit not set - --> $DIR/def-inits-1.rs:34:14 + --> $DIR/def-inits-1.rs:33:14 | LL | unsafe { rustc_peek(&y); } | ^^^^^^^^^^^^^^ error: rustc_peek: bit not set - --> $DIR/def-inits-1.rs:42:14 + --> $DIR/def-inits-1.rs:41:14 | LL | unsafe { rustc_peek(&x); } | ^^^^^^^^^^^^^^ diff --git a/src/test/ui/mir-dataflow/inits-1.rs b/src/test/ui/mir-dataflow/inits-1.rs index 13f900e4a75..4a4786a2a73 100644 --- a/src/test/ui/mir-dataflow/inits-1.rs +++ b/src/test/ui/mir-dataflow/inits-1.rs @@ -1,6 +1,5 @@ // General test of maybe_inits state computed by MIR dataflow. -#![feature(nll)] #![feature(core_intrinsics, rustc_attrs)] use std::intrinsics::rustc_peek; diff --git a/src/test/ui/mir-dataflow/inits-1.stderr b/src/test/ui/mir-dataflow/inits-1.stderr index 38a9c60b168..23d0679cb1a 100644 --- a/src/test/ui/mir-dataflow/inits-1.stderr +++ b/src/test/ui/mir-dataflow/inits-1.stderr @@ -1,17 +1,17 @@ error: rustc_peek: bit not set - --> $DIR/inits-1.rs:15:14 + --> $DIR/inits-1.rs:14:14 | LL | unsafe { rustc_peek(&ret); } | ^^^^^^^^^^^^^^^^ error: rustc_peek: bit not set - --> $DIR/inits-1.rs:35:14 + --> $DIR/inits-1.rs:34:14 | LL | unsafe { rustc_peek(&y); } | ^^^^^^^^^^^^^^ error: rustc_peek: bit not set - --> $DIR/inits-1.rs:43:14 + --> $DIR/inits-1.rs:42:14 | LL | unsafe { rustc_peek(&x); } | ^^^^^^^^^^^^^^ diff --git a/src/test/ui/mir-dataflow/uninits-1.rs b/src/test/ui/mir-dataflow/uninits-1.rs index 4c643596932..66b3f458a51 100644 --- a/src/test/ui/mir-dataflow/uninits-1.rs +++ b/src/test/ui/mir-dataflow/uninits-1.rs @@ -1,6 +1,5 @@ // General test of maybe_uninits state computed by MIR dataflow. -#![feature(nll)] #![feature(core_intrinsics, rustc_attrs)] use std::intrinsics::rustc_peek; diff --git a/src/test/ui/mir-dataflow/uninits-1.stderr b/src/test/ui/mir-dataflow/uninits-1.stderr index c60987050e6..5f6dbde212d 100644 --- a/src/test/ui/mir-dataflow/uninits-1.stderr +++ b/src/test/ui/mir-dataflow/uninits-1.stderr @@ -1,29 +1,29 @@ error: rustc_peek: bit not set - --> $DIR/uninits-1.rs:19:14 + --> $DIR/uninits-1.rs:18:14 | LL | unsafe { rustc_peek(&x) }; | ^^^^^^^^^^^^^^ error: rustc_peek: bit not set - --> $DIR/uninits-1.rs:20:14 + --> $DIR/uninits-1.rs:19:14 | LL | unsafe { rustc_peek(&y) }; | ^^^^^^^^^^^^^^ error: rustc_peek: bit not set - --> $DIR/uninits-1.rs:21:14 + --> $DIR/uninits-1.rs:20:14 | LL | unsafe { rustc_peek(&z) }; | ^^^^^^^^^^^^^^ error: rustc_peek: bit not set - --> $DIR/uninits-1.rs:37:14 + --> $DIR/uninits-1.rs:36:14 | LL | unsafe { rustc_peek(&x); } | ^^^^^^^^^^^^^^ error: rustc_peek: bit not set - --> $DIR/uninits-1.rs:45:14 + --> $DIR/uninits-1.rs:44:14 | LL | unsafe { rustc_peek(&ret); } | ^^^^^^^^^^^^^^^^ diff --git a/src/test/ui/mir-dataflow/uninits-2.rs b/src/test/ui/mir-dataflow/uninits-2.rs index 2247e68d097..2ccf1c7f9d6 100644 --- a/src/test/ui/mir-dataflow/uninits-2.rs +++ b/src/test/ui/mir-dataflow/uninits-2.rs @@ -1,6 +1,5 @@ // General test of maybe_uninits state computed by MIR dataflow. -#![feature(nll)] #![feature(core_intrinsics, rustc_attrs)] use std::intrinsics::rustc_peek; diff --git a/src/test/ui/mir-dataflow/uninits-2.stderr b/src/test/ui/mir-dataflow/uninits-2.stderr index de3e58e52de..dcb61371994 100644 --- a/src/test/ui/mir-dataflow/uninits-2.stderr +++ b/src/test/ui/mir-dataflow/uninits-2.stderr @@ -1,5 +1,5 @@ error: rustc_peek: bit not set - --> $DIR/uninits-2.rs:15:14 + --> $DIR/uninits-2.rs:14:14 | LL | unsafe { rustc_peek(&x) }; | ^^^^^^^^^^^^^^ diff --git a/src/test/ui/nll/borrow-use-issue-46875.rs b/src/test/ui/nll/borrow-use-issue-46875.rs index 03db28fc508..42e28b9674b 100644 --- a/src/test/ui/nll/borrow-use-issue-46875.rs +++ b/src/test/ui/nll/borrow-use-issue-46875.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // run-pass fn vec() { diff --git a/src/test/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.rs b/src/test/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.rs index 59936a80925..7d3b00dfc71 100644 --- a/src/test/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.rs +++ b/src/test/ui/nll/borrowck-thread-local-static-mut-borrow-outlives-fn.rs @@ -3,7 +3,6 @@ // // FIXME(#54366) - We probably shouldn't allow #[thread_local] static mut to get a 'static lifetime. -#![feature(nll)] #![feature(thread_local)] #[thread_local] diff --git a/src/test/ui/nll/borrowed-local-error.rs b/src/test/ui/nll/borrowed-local-error.rs index d37e61b63a8..d333356d964 100644 --- a/src/test/ui/nll/borrowed-local-error.rs +++ b/src/test/ui/nll/borrowed-local-error.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn gimme(x: &(u32,)) -> &u32 { &x.0 } diff --git a/src/test/ui/nll/borrowed-local-error.stderr b/src/test/ui/nll/borrowed-local-error.stderr index 799eec9d342..d629caa4353 100644 --- a/src/test/ui/nll/borrowed-local-error.stderr +++ b/src/test/ui/nll/borrowed-local-error.stderr @@ -1,5 +1,5 @@ error[E0597]: `v` does not live long enough - --> $DIR/borrowed-local-error.rs:10:9 + --> $DIR/borrowed-local-error.rs:8:9 | LL | let x = gimme({ | ----- borrow later used by call diff --git a/src/test/ui/nll/borrowed-referent-issue-38899.rs b/src/test/ui/nll/borrowed-referent-issue-38899.rs index 7bad6dc2cd3..d4b05fb7931 100644 --- a/src/test/ui/nll/borrowed-referent-issue-38899.rs +++ b/src/test/ui/nll/borrowed-referent-issue-38899.rs @@ -1,7 +1,6 @@ // Regression test for issue #38899 #![feature(nll)] -#![allow(dead_code)] pub struct Block<'a> { current: &'a u8, diff --git a/src/test/ui/nll/borrowed-referent-issue-38899.stderr b/src/test/ui/nll/borrowed-referent-issue-38899.stderr index 5c9c48f5b1d..38a6e27a0e5 100644 --- a/src/test/ui/nll/borrowed-referent-issue-38899.stderr +++ b/src/test/ui/nll/borrowed-referent-issue-38899.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `*block.current` as immutable because it is also borrowed as mutable - --> $DIR/borrowed-referent-issue-38899.rs:14:21 + --> $DIR/borrowed-referent-issue-38899.rs:13:21 | LL | let x = &mut block; | ---------- mutable borrow occurs here diff --git a/src/test/ui/nll/borrowed-temporary-error.rs b/src/test/ui/nll/borrowed-temporary-error.rs index 5ad987c7214..37d0e670d35 100644 --- a/src/test/ui/nll/borrowed-temporary-error.rs +++ b/src/test/ui/nll/borrowed-temporary-error.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn gimme(x: &(u32,)) -> &u32 { &x.0 } diff --git a/src/test/ui/nll/borrowed-temporary-error.stderr b/src/test/ui/nll/borrowed-temporary-error.stderr index c0d42312eb1..2c6bd92641f 100644 --- a/src/test/ui/nll/borrowed-temporary-error.stderr +++ b/src/test/ui/nll/borrowed-temporary-error.stderr @@ -1,5 +1,5 @@ error[E0716]: temporary value dropped while borrowed - --> $DIR/borrowed-temporary-error.rs:10:10 + --> $DIR/borrowed-temporary-error.rs:8:10 | LL | &(v,) | ^^^^ creates a temporary which is freed while still in use diff --git a/src/test/ui/nll/borrowed-universal-error-2.rs b/src/test/ui/nll/borrowed-universal-error-2.rs index a10a62b470d..3f9b2f2924c 100644 --- a/src/test/ui/nll/borrowed-universal-error-2.rs +++ b/src/test/ui/nll/borrowed-universal-error-2.rs @@ -1,6 +1,3 @@ -#![feature(nll)] -#![allow(warnings)] - fn foo<'a>(x: &'a (u32,)) -> &'a u32 { let v = 22; &v diff --git a/src/test/ui/nll/borrowed-universal-error-2.stderr b/src/test/ui/nll/borrowed-universal-error-2.stderr index e89a77a2d36..7213ed3bafb 100644 --- a/src/test/ui/nll/borrowed-universal-error-2.stderr +++ b/src/test/ui/nll/borrowed-universal-error-2.stderr @@ -1,5 +1,5 @@ error[E0515]: cannot return reference to local variable `v` - --> $DIR/borrowed-universal-error-2.rs:6:5 + --> $DIR/borrowed-universal-error-2.rs:3:5 | LL | &v | ^^ returns a reference to data owned by the current function diff --git a/src/test/ui/nll/borrowed-universal-error.rs b/src/test/ui/nll/borrowed-universal-error.rs index 18a0a72c4bb..fc9ffd47061 100644 --- a/src/test/ui/nll/borrowed-universal-error.rs +++ b/src/test/ui/nll/borrowed-universal-error.rs @@ -1,6 +1,3 @@ -#![feature(nll)] -#![allow(warnings)] - fn gimme(x: &(u32,)) -> &u32 { &x.0 } diff --git a/src/test/ui/nll/borrowed-universal-error.stderr b/src/test/ui/nll/borrowed-universal-error.stderr index 4b76795943e..88a2d8fcf8c 100644 --- a/src/test/ui/nll/borrowed-universal-error.stderr +++ b/src/test/ui/nll/borrowed-universal-error.stderr @@ -1,5 +1,5 @@ error[E0515]: cannot return value referencing temporary value - --> $DIR/borrowed-universal-error.rs:10:5 + --> $DIR/borrowed-universal-error.rs:7:5 | LL | gimme(&(v,)) | ^^^^^^^----^ diff --git a/src/test/ui/nll/capture-mut-ref.rs b/src/test/ui/nll/capture-mut-ref.rs index 222f4e71c52..9d2624a9d6f 100644 --- a/src/test/ui/nll/capture-mut-ref.rs +++ b/src/test/ui/nll/capture-mut-ref.rs @@ -1,7 +1,6 @@ // Check that capturing a mutable reference by move and assigning to its // referent doesn't make the unused mut lint think that it is mutable. -#![feature(nll)] #![deny(unused_mut)] fn mutable_upvar() { diff --git a/src/test/ui/nll/capture-mut-ref.stderr b/src/test/ui/nll/capture-mut-ref.stderr index 327ce0c6e81..883b2d05a7f 100644 --- a/src/test/ui/nll/capture-mut-ref.stderr +++ b/src/test/ui/nll/capture-mut-ref.stderr @@ -1,5 +1,5 @@ error: variable does not need to be mutable - --> $DIR/capture-mut-ref.rs:8:9 + --> $DIR/capture-mut-ref.rs:7:9 | LL | let mut x = &mut 0; | ----^ @@ -7,7 +7,7 @@ LL | let mut x = &mut 0; | help: remove this `mut` | note: lint level defined here - --> $DIR/capture-mut-ref.rs:5:9 + --> $DIR/capture-mut-ref.rs:4:9 | LL | #![deny(unused_mut)] | ^^^^^^^^^^ diff --git a/src/test/ui/nll/capture-ref-in-struct.rs b/src/test/ui/nll/capture-ref-in-struct.rs index bf2db32901e..db6ac7d66cc 100644 --- a/src/test/ui/nll/capture-ref-in-struct.rs +++ b/src/test/ui/nll/capture-ref-in-struct.rs @@ -1,9 +1,6 @@ // Test that a structure which tries to store a pointer to `y` into // `p` (indirectly) fails to compile. -#![feature(rustc_attrs)] -#![feature(nll)] - struct SomeStruct<'a, 'b: 'a> { p: &'a mut &'b i32, y: &'b i32, diff --git a/src/test/ui/nll/capture-ref-in-struct.stderr b/src/test/ui/nll/capture-ref-in-struct.stderr index 7fafb4474fd..521e543bd26 100644 --- a/src/test/ui/nll/capture-ref-in-struct.stderr +++ b/src/test/ui/nll/capture-ref-in-struct.stderr @@ -1,5 +1,5 @@ error[E0597]: `y` does not live long enough - --> $DIR/capture-ref-in-struct.rs:21:16 + --> $DIR/capture-ref-in-struct.rs:18:16 | LL | y: &y, | ^^ borrowed value does not live long enough diff --git a/src/test/ui/nll/closure-access-spans.rs b/src/test/ui/nll/closure-access-spans.rs index 1e11b481818..2a59e80b25c 100644 --- a/src/test/ui/nll/closure-access-spans.rs +++ b/src/test/ui/nll/closure-access-spans.rs @@ -1,7 +1,5 @@ // check that accesses due to a closure capture give a special note -#![feature(nll)] - fn closure_imm_capture_conflict(mut x: i32) { let r = &mut x; || x; //~ ERROR diff --git a/src/test/ui/nll/closure-access-spans.stderr b/src/test/ui/nll/closure-access-spans.stderr index 32958e28a3d..4a8086905b7 100644 --- a/src/test/ui/nll/closure-access-spans.stderr +++ b/src/test/ui/nll/closure-access-spans.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/closure-access-spans.rs:7:5 + --> $DIR/closure-access-spans.rs:5:5 | LL | let r = &mut x; | ------ mutable borrow occurs here @@ -11,7 +11,7 @@ LL | r.use_mut(); | - mutable borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/closure-access-spans.rs:13:5 + --> $DIR/closure-access-spans.rs:11:5 | LL | let r = &mut x; | ------ first mutable borrow occurs here @@ -23,7 +23,7 @@ LL | r.use_mut(); | - first borrow later used here error[E0500]: closure requires unique access to `x` but it is already borrowed - --> $DIR/closure-access-spans.rs:19:5 + --> $DIR/closure-access-spans.rs:17:5 | LL | let r = &mut x; | ------ borrow occurs here @@ -35,7 +35,7 @@ LL | r.use_mut(); | - first borrow later used here error[E0503]: cannot use `x` because it was mutably borrowed - --> $DIR/closure-access-spans.rs:25:13 + --> $DIR/closure-access-spans.rs:23:13 | LL | let r = &mut x; | ------ borrow of `x` occurs here @@ -45,7 +45,7 @@ LL | r.use_ref(); | - borrow later used here error[E0505]: cannot move out of `x` because it is borrowed - --> $DIR/closure-access-spans.rs:31:5 + --> $DIR/closure-access-spans.rs:29:5 | LL | let r = &x; | -- borrow of `x` occurs here @@ -57,7 +57,7 @@ LL | r.use_ref(); | - borrow later used here error[E0382]: borrow of moved value: `x` - --> $DIR/closure-access-spans.rs:37:5 + --> $DIR/closure-access-spans.rs:35:5 | LL | fn closure_imm_capture_moved(mut x: String) { | ----- move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait @@ -69,7 +69,7 @@ LL | || x.len(); | value borrowed here after move error[E0382]: borrow of moved value: `x` - --> $DIR/closure-access-spans.rs:42:5 + --> $DIR/closure-access-spans.rs:40:5 | LL | fn closure_mut_capture_moved(mut x: String) { | ----- move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait @@ -81,7 +81,7 @@ LL | || x = String::new(); | value borrowed here after move error[E0382]: borrow of moved value: `x` - --> $DIR/closure-access-spans.rs:47:5 + --> $DIR/closure-access-spans.rs:45:5 | LL | fn closure_unique_capture_moved(x: &mut String) { | - move occurs because `x` has type `&mut std::string::String`, which does not implement the `Copy` trait @@ -93,7 +93,7 @@ LL | || *x = String::new(); | value borrowed here after move error[E0382]: use of moved value: `x` - --> $DIR/closure-access-spans.rs:52:5 + --> $DIR/closure-access-spans.rs:50:5 | LL | fn closure_move_capture_moved(x: &mut String) { | - move occurs because `x` has type `&mut std::string::String`, which does not implement the `Copy` trait diff --git a/src/test/ui/nll/closure-borrow-spans.rs b/src/test/ui/nll/closure-borrow-spans.rs index 7fc301b7038..b38f7900e8e 100644 --- a/src/test/ui/nll/closure-borrow-spans.rs +++ b/src/test/ui/nll/closure-borrow-spans.rs @@ -1,7 +1,5 @@ // check that existing borrows due to a closure capture give a special note -#![feature(nll)] - fn move_while_borrowed(x: String) { let f = || x.len(); let y = x; //~ ERROR diff --git a/src/test/ui/nll/closure-borrow-spans.stderr b/src/test/ui/nll/closure-borrow-spans.stderr index 30d99d56678..a3bcbbab3ec 100644 --- a/src/test/ui/nll/closure-borrow-spans.stderr +++ b/src/test/ui/nll/closure-borrow-spans.stderr @@ -1,5 +1,5 @@ error[E0505]: cannot move out of `x` because it is borrowed - --> $DIR/closure-borrow-spans.rs:7:13 + --> $DIR/closure-borrow-spans.rs:5:13 | LL | let f = || x.len(); | -- - borrow occurs due to use in closure @@ -11,7 +11,7 @@ LL | f.use_ref(); | - borrow later used here error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable - --> $DIR/closure-borrow-spans.rs:13:13 + --> $DIR/closure-borrow-spans.rs:11:13 | LL | let f = || x; | -- - first borrow occurs due to use of `x` in closure @@ -23,7 +23,7 @@ LL | f.use_ref(); | - immutable borrow later used here error[E0597]: `x` does not live long enough - --> $DIR/closure-borrow-spans.rs:21:16 + --> $DIR/closure-borrow-spans.rs:19:16 | LL | f = || x; | -- ^ borrowed value does not live long enough @@ -35,7 +35,7 @@ LL | f.use_ref(); | - borrow later used here error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/closure-borrow-spans.rs:28:5 + --> $DIR/closure-borrow-spans.rs:26:5 | LL | let f = || x; | -- - borrow occurs due to use in closure @@ -47,7 +47,7 @@ LL | f.use_ref(); | - borrow later used here error[E0503]: cannot use `x` because it was mutably borrowed - --> $DIR/closure-borrow-spans.rs:34:13 + --> $DIR/closure-borrow-spans.rs:32:13 | LL | let f = || x = 0; | -- - borrow occurs due to use of `x` in closure @@ -59,7 +59,7 @@ LL | f.use_ref(); | - borrow later used here error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable - --> $DIR/closure-borrow-spans.rs:40:13 + --> $DIR/closure-borrow-spans.rs:38:13 | LL | let f = || x = 0; | -- - first borrow occurs due to use of `x` in closure @@ -71,7 +71,7 @@ LL | f.use_ref(); | - mutable borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/closure-borrow-spans.rs:46:13 + --> $DIR/closure-borrow-spans.rs:44:13 | LL | let f = || x = 0; | -- - first borrow occurs due to use of `x` in closure @@ -83,7 +83,7 @@ LL | f.use_ref(); | - first borrow later used here error[E0597]: `x` does not live long enough - --> $DIR/closure-borrow-spans.rs:54:16 + --> $DIR/closure-borrow-spans.rs:52:16 | LL | f = || x = 0; | -- ^ borrowed value does not live long enough @@ -95,7 +95,7 @@ LL | f.use_ref(); | - borrow later used here error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/closure-borrow-spans.rs:61:5 + --> $DIR/closure-borrow-spans.rs:59:5 | LL | let f = || x = 0; | -- - borrow occurs due to use in closure @@ -107,7 +107,7 @@ LL | f.use_ref(); | - borrow later used here error[E0505]: cannot move out of `x` because it is borrowed - --> $DIR/closure-borrow-spans.rs:67:13 + --> $DIR/closure-borrow-spans.rs:65:13 | LL | let f = || *x = 0; | -- - borrow occurs due to use in closure @@ -119,7 +119,7 @@ LL | f.use_ref(); | - borrow later used here error[E0501]: cannot borrow `x` as immutable because previous closure requires unique access - --> $DIR/closure-borrow-spans.rs:73:13 + --> $DIR/closure-borrow-spans.rs:71:13 | LL | let f = || *x = 0; | -- - first borrow occurs due to use of `x` in closure @@ -131,7 +131,7 @@ LL | f.use_ref(); | - first borrow later used here error[E0501]: cannot borrow `x` as mutable because previous closure requires unique access - --> $DIR/closure-borrow-spans.rs:79:13 + --> $DIR/closure-borrow-spans.rs:77:13 | LL | let f = || *x = 0; | -- - first borrow occurs due to use of `x` in closure @@ -143,7 +143,7 @@ LL | f.use_ref(); | - first borrow later used here error[E0597]: `x` does not live long enough - --> $DIR/closure-borrow-spans.rs:88:17 + --> $DIR/closure-borrow-spans.rs:86:17 | LL | f = || *x = 0; | -- ^ borrowed value does not live long enough @@ -155,7 +155,7 @@ LL | f.use_ref(); | - borrow later used here error[E0506]: cannot assign to `*x` because it is borrowed - --> $DIR/closure-borrow-spans.rs:95:5 + --> $DIR/closure-borrow-spans.rs:93:5 | LL | let f = || *x = 0; | -- - borrow occurs due to use in closure diff --git a/src/test/ui/nll/closure-captures.rs b/src/test/ui/nll/closure-captures.rs index 3a01f86cad8..16d90b97174 100644 --- a/src/test/ui/nll/closure-captures.rs +++ b/src/test/ui/nll/closure-captures.rs @@ -1,8 +1,5 @@ // Some cases with closures that might be problems -#![allow(unused)] -#![feature(nll)] - // Should have one error per assignment fn one_closure(x: i32) { diff --git a/src/test/ui/nll/closure-captures.stderr b/src/test/ui/nll/closure-captures.stderr index fbd02bc8095..77f7d815eeb 100644 --- a/src/test/ui/nll/closure-captures.stderr +++ b/src/test/ui/nll/closure-captures.stderr @@ -1,5 +1,5 @@ error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/closure-captures.rs:10:5 + --> $DIR/closure-captures.rs:7:5 | LL | fn one_closure(x: i32) { | - help: consider changing this to be mutable: `mut x` @@ -8,7 +8,7 @@ LL | x = 1; | ^^^^^ cannot assign error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/closure-captures.rs:12:5 + --> $DIR/closure-captures.rs:9:5 | LL | fn one_closure(x: i32) { | - help: consider changing this to be mutable: `mut x` @@ -17,7 +17,7 @@ LL | x = 1; | ^^^^^ cannot assign error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/closure-captures.rs:18:9 + --> $DIR/closure-captures.rs:15:9 | LL | fn two_closures(x: i32) { | - help: consider changing this to be mutable: `mut x` @@ -26,7 +26,7 @@ LL | x = 1; | ^^^^^ cannot assign error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/closure-captures.rs:22:9 + --> $DIR/closure-captures.rs:19:9 | LL | fn two_closures(x: i32) { | - help: consider changing this to be mutable: `mut x` @@ -35,7 +35,7 @@ LL | x = 1; | ^^^^^ cannot assign error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/closure-captures.rs:30:9 + --> $DIR/closure-captures.rs:27:9 | LL | || | ^^ cannot borrow as mutable @@ -43,7 +43,7 @@ LL | x = 1;} | - mutable borrow occurs due to use of `x` in closure | help: consider changing this to accept closures that implement `FnMut` - --> $DIR/closure-captures.rs:29:12 + --> $DIR/closure-captures.rs:26:12 | LL | fn_ref(|| { | ____________^ @@ -52,7 +52,7 @@ LL | | x = 1;} | |________________^ error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/closure-captures.rs:34:9 + --> $DIR/closure-captures.rs:31:9 | LL | || | ^^ cannot borrow as mutable @@ -60,7 +60,7 @@ LL | x = 1;}); | - mutable borrow occurs due to use of `x` in closure | help: consider changing this to accept closures that implement `FnMut` - --> $DIR/closure-captures.rs:33:12 + --> $DIR/closure-captures.rs:30:12 | LL | fn_ref(move || { | ____________^ @@ -69,7 +69,7 @@ LL | | x = 1;}); | |___________^ error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/closure-captures.rs:42:10 + --> $DIR/closure-captures.rs:39:10 | LL | fn two_closures_ref(x: i32) { | - help: consider changing this to be mutable: `mut x` @@ -78,7 +78,7 @@ LL | x = 1;} | ^^^^^ cannot assign error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/closure-captures.rs:41:9 + --> $DIR/closure-captures.rs:38:9 | LL | || | ^^ cannot borrow as mutable @@ -86,7 +86,7 @@ LL | x = 1;} | - mutable borrow occurs due to use of `x` in closure | help: consider changing this to accept closures that implement `FnMut` - --> $DIR/closure-captures.rs:40:12 + --> $DIR/closure-captures.rs:37:12 | LL | fn_ref(|| { | ____________^ @@ -95,7 +95,7 @@ LL | | x = 1;} | |________________^ error[E0594]: cannot assign to `x`, as it is not declared as mutable - --> $DIR/closure-captures.rs:46:5 + --> $DIR/closure-captures.rs:43:5 | LL | fn two_closures_ref(x: i32) { | - help: consider changing this to be mutable: `mut x` @@ -104,7 +104,7 @@ LL | x = 1;}); | ^^^^^ cannot assign error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/closure-captures.rs:45:9 + --> $DIR/closure-captures.rs:42:9 | LL | || | ^^ cannot borrow as mutable @@ -112,7 +112,7 @@ LL | x = 1;}); | - mutable borrow occurs due to use of `x` in closure | help: consider changing this to accept closures that implement `FnMut` - --> $DIR/closure-captures.rs:44:12 + --> $DIR/closure-captures.rs:41:12 | LL | fn_ref(move || { | ____________^ @@ -120,6 +120,23 @@ LL | | || LL | | x = 1;}); | |___________^ +error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure + --> $DIR/closure-captures.rs:48:9 + | +LL | || + | ^^ cannot borrow as mutable +LL | *x = 1;}); + | - mutable borrow occurs due to use of `x` in closure + | +help: consider changing this to accept closures that implement `FnMut` + --> $DIR/closure-captures.rs:47:12 + | +LL | fn_ref(|| { + | ____________^ +LL | | || +LL | | *x = 1;}); + | |________________^ + error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure --> $DIR/closure-captures.rs:51:9 | @@ -131,23 +148,6 @@ LL | *x = 1;}); help: consider changing this to accept closures that implement `FnMut` --> $DIR/closure-captures.rs:50:12 | -LL | fn_ref(|| { - | ____________^ -LL | | || -LL | | *x = 1;}); - | |________________^ - -error[E0596]: cannot borrow `x` as mutable, as it is a captured variable in a `Fn` closure - --> $DIR/closure-captures.rs:54:9 - | -LL | || - | ^^ cannot borrow as mutable -LL | *x = 1;}); - | - mutable borrow occurs due to use of `x` in closure - | -help: consider changing this to accept closures that implement `FnMut` - --> $DIR/closure-captures.rs:53:12 - | LL | fn_ref(move || { | ____________^ LL | | || diff --git a/src/test/ui/nll/closure-move-spans.rs b/src/test/ui/nll/closure-move-spans.rs index ffbfa9f8ae4..bf2431870a9 100644 --- a/src/test/ui/nll/closure-move-spans.rs +++ b/src/test/ui/nll/closure-move-spans.rs @@ -1,7 +1,5 @@ // check that moves due to a closure capture give a special note -#![feature(nll)] - fn move_after_move(x: String) { || x; let y = x; //~ ERROR diff --git a/src/test/ui/nll/closure-move-spans.stderr b/src/test/ui/nll/closure-move-spans.stderr index 1cc4ca85b9f..972dbc6a61d 100644 --- a/src/test/ui/nll/closure-move-spans.stderr +++ b/src/test/ui/nll/closure-move-spans.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `x` - --> $DIR/closure-move-spans.rs:7:13 + --> $DIR/closure-move-spans.rs:5:13 | LL | fn move_after_move(x: String) { | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait @@ -11,7 +11,7 @@ LL | let y = x; | ^ value used here after move error[E0382]: borrow of moved value: `x` - --> $DIR/closure-move-spans.rs:12:13 + --> $DIR/closure-move-spans.rs:10:13 | LL | fn borrow_after_move(x: String) { | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait @@ -23,7 +23,7 @@ LL | let y = &x; | ^^ value borrowed here after move error[E0382]: borrow of moved value: `x` - --> $DIR/closure-move-spans.rs:17:13 + --> $DIR/closure-move-spans.rs:15:13 | LL | fn borrow_mut_after_move(mut x: String) { | ----- move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait diff --git a/src/test/ui/nll/closure-requirements/issue-58127-mutliple-requirements.rs b/src/test/ui/nll/closure-requirements/issue-58127-mutliple-requirements.rs index 71d5d4053ee..8ed6554877e 100644 --- a/src/test/ui/nll/closure-requirements/issue-58127-mutliple-requirements.rs +++ b/src/test/ui/nll/closure-requirements/issue-58127-mutliple-requirements.rs @@ -1,7 +1,3 @@ -// revisions: migrate nll -//[migrate]compile-flags: -Z borrowck=migrate -#![cfg_attr(nll, feature(nll))] - // compile-pass // Test that we propagate region relations from closures precisely when there is diff --git a/src/test/ui/nll/closure-requirements/propagate-multiple-requirements.rs b/src/test/ui/nll/closure-requirements/propagate-multiple-requirements.rs index dbc659b4aee..a9d2a07715d 100644 --- a/src/test/ui/nll/closure-requirements/propagate-multiple-requirements.rs +++ b/src/test/ui/nll/closure-requirements/propagate-multiple-requirements.rs @@ -1,8 +1,6 @@ // Test that we propagate *all* requirements to the caller, not just the first // one. -#![feature(nll)] - fn once U>(f: F, s: S, t: T) -> U { f(s, t) } diff --git a/src/test/ui/nll/closure-requirements/propagate-multiple-requirements.stderr b/src/test/ui/nll/closure-requirements/propagate-multiple-requirements.stderr index 332724daaa8..2fec9bc62d1 100644 --- a/src/test/ui/nll/closure-requirements/propagate-multiple-requirements.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-multiple-requirements.stderr @@ -1,5 +1,5 @@ error[E0597]: `local_arr` does not live long enough - --> $DIR/propagate-multiple-requirements.rs:17:14 + --> $DIR/propagate-multiple-requirements.rs:15:14 | LL | let mut out: &mut &'static [i32] = &mut (&[1] as _); | ------------------- type annotation requires that `local_arr` is borrowed for `'static` diff --git a/src/test/ui/nll/closure-use-spans.rs b/src/test/ui/nll/closure-use-spans.rs index c7cd519cffb..6768250dcbc 100644 --- a/src/test/ui/nll/closure-use-spans.rs +++ b/src/test/ui/nll/closure-use-spans.rs @@ -1,7 +1,5 @@ // check that liveness due to a closure capture gives a special note -#![feature(nll)] - fn use_as_borrow_capture(mut x: i32) { let y = &x; x = 0; //~ ERROR diff --git a/src/test/ui/nll/closure-use-spans.stderr b/src/test/ui/nll/closure-use-spans.stderr index 20696da3b8e..ec7e0f30855 100644 --- a/src/test/ui/nll/closure-use-spans.stderr +++ b/src/test/ui/nll/closure-use-spans.stderr @@ -1,5 +1,5 @@ error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/closure-use-spans.rs:7:5 + --> $DIR/closure-use-spans.rs:5:5 | LL | let y = &x; | -- borrow of `x` occurs here @@ -9,7 +9,7 @@ LL | || *y; | - borrow later captured here by closure error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/closure-use-spans.rs:13:5 + --> $DIR/closure-use-spans.rs:11:5 | LL | let y = &mut x; | ------ borrow of `x` occurs here @@ -19,7 +19,7 @@ LL | || *y = 1; | - borrow later captured here by closure error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/closure-use-spans.rs:19:5 + --> $DIR/closure-use-spans.rs:17:5 | LL | let y = &x; | -- borrow of `x` occurs here diff --git a/src/test/ui/nll/closures-in-loops.rs b/src/test/ui/nll/closures-in-loops.rs index d2afa564734..491c186ecb5 100644 --- a/src/test/ui/nll/closures-in-loops.rs +++ b/src/test/ui/nll/closures-in-loops.rs @@ -1,8 +1,6 @@ // Test messages where a closure capture conflicts with itself because it's in // a loop. -#![feature(nll)] - fn repreated_move(x: String) { for i in 0..10 { || x; //~ ERROR diff --git a/src/test/ui/nll/closures-in-loops.stderr b/src/test/ui/nll/closures-in-loops.stderr index 692eaea92b8..7603f9650b5 100644 --- a/src/test/ui/nll/closures-in-loops.stderr +++ b/src/test/ui/nll/closures-in-loops.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `x` - --> $DIR/closures-in-loops.rs:8:9 + --> $DIR/closures-in-loops.rs:6:9 | LL | fn repreated_move(x: String) { | - move occurs because `x` has type `std::string::String`, which does not implement the `Copy` trait @@ -10,7 +10,7 @@ LL | || x; | value moved into closure here, in previous iteration of loop error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/closures-in-loops.rs:15:16 + --> $DIR/closures-in-loops.rs:13:16 | LL | v.push(|| x = String::new()); | ^^ - borrows occur due to use of `x` in closure @@ -18,7 +18,7 @@ LL | v.push(|| x = String::new()); | mutable borrow starts here in previous iteration of loop error[E0524]: two closures require unique access to `x` at the same time - --> $DIR/closures-in-loops.rs:22:16 + --> $DIR/closures-in-loops.rs:20:16 | LL | v.push(|| *x = String::new()); | ^^ - borrows occur due to use of `x` in closure diff --git a/src/test/ui/nll/constant-thread-locals-issue-47053.rs b/src/test/ui/nll/constant-thread-locals-issue-47053.rs index 4dd01410c5e..dde0ef7a5bb 100644 --- a/src/test/ui/nll/constant-thread-locals-issue-47053.rs +++ b/src/test/ui/nll/constant-thread-locals-issue-47053.rs @@ -1,6 +1,5 @@ // Regression test for issue #47053 -#![feature(nll)] #![feature(thread_local)] #[thread_local] diff --git a/src/test/ui/nll/constant-thread-locals-issue-47053.stderr b/src/test/ui/nll/constant-thread-locals-issue-47053.stderr index 16a6e59e4da..8afb42d66a6 100644 --- a/src/test/ui/nll/constant-thread-locals-issue-47053.stderr +++ b/src/test/ui/nll/constant-thread-locals-issue-47053.stderr @@ -1,5 +1,5 @@ error[E0594]: cannot assign to immutable static item `FOO` - --> $DIR/constant-thread-locals-issue-47053.rs:10:5 + --> $DIR/constant-thread-locals-issue-47053.rs:9:5 | LL | FOO = 6; | ^^^^^^^ cannot assign diff --git a/src/test/ui/nll/decl-macro-illegal-copy.rs b/src/test/ui/nll/decl-macro-illegal-copy.rs index 38bdb7dd270..f7243294669 100644 --- a/src/test/ui/nll/decl-macro-illegal-copy.rs +++ b/src/test/ui/nll/decl-macro-illegal-copy.rs @@ -1,6 +1,5 @@ // Regression test for #46314 -#![feature(nll)] #![feature(decl_macro)] struct NonCopy(String); diff --git a/src/test/ui/nll/decl-macro-illegal-copy.stderr b/src/test/ui/nll/decl-macro-illegal-copy.stderr index 9232ff52393..7948485bd68 100644 --- a/src/test/ui/nll/decl-macro-illegal-copy.stderr +++ b/src/test/ui/nll/decl-macro-illegal-copy.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `wrapper.inner` - --> $DIR/decl-macro-illegal-copy.rs:22:9 + --> $DIR/decl-macro-illegal-copy.rs:21:9 | LL | $wrapper.inner | -------------- value moved here diff --git a/src/test/ui/nll/issue-16223.rs b/src/test/ui/nll/issue-16223.rs index 881e202acf8..e7536275064 100644 --- a/src/test/ui/nll/issue-16223.rs +++ b/src/test/ui/nll/issue-16223.rs @@ -15,7 +15,6 @@ // compile-pass -#![feature(nll)] #![feature(box_patterns)] struct Root { diff --git a/src/test/ui/nll/issue-21114-ebfull.rs b/src/test/ui/nll/issue-21114-ebfull.rs index f5738968746..1fe4fffa324 100644 --- a/src/test/ui/nll/issue-21114-ebfull.rs +++ b/src/test/ui/nll/issue-21114-ebfull.rs @@ -1,6 +1,4 @@ -// (this works, but only in NLL) // compile-pass -#![feature(nll)] use std::collections::HashMap; use std::sync::Mutex; diff --git a/src/test/ui/nll/issue-21114-kixunil.rs b/src/test/ui/nll/issue-21114-kixunil.rs index 2add951b70b..80a85293e5a 100644 --- a/src/test/ui/nll/issue-21114-kixunil.rs +++ b/src/test/ui/nll/issue-21114-kixunil.rs @@ -1,6 +1,4 @@ -// (this works, but only in NLL) // compile-pass -#![feature(nll)] fn from_stdin(min: u64) -> Vec { use std::io::BufRead; diff --git a/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.rs b/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.rs index abafd330573..906ea32b9c4 100644 --- a/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.rs +++ b/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.rs @@ -8,8 +8,6 @@ // meant to compile and run successfully once rust-lang/rust#54987 is // implemented. -#![feature(nll)] - struct D { x: u32, s: S, diff --git a/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.stderr b/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.stderr index 862432a5bc6..153d9bdf321 100644 --- a/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.stderr +++ b/src/test/ui/nll/issue-21232-partial-init-and-erroneous-use.stderr @@ -1,17 +1,17 @@ error[E0381]: assign of possibly uninitialized variable: `d` - --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:30:5 + --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:28:5 | LL | d.x = 10; | ^^^^^^^^ use of possibly uninitialized `d` error[E0381]: assign of possibly uninitialized variable: `d` - --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:36:5 + --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:34:5 | LL | d.x = 10; | ^^^^^^^^ use of possibly uninitialized `d` error[E0382]: assign of moved value: `d` - --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:43:5 + --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:41:5 | LL | let mut d = D { x: 0, s: S{ y: 0, z: 0 } }; | ----- move occurs because `d` has type `D`, which does not implement the `Copy` trait @@ -21,19 +21,19 @@ LL | d.x = 10; | ^^^^^^^^ value assigned here after move error[E0381]: assign to part of possibly uninitialized variable: `d` - --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:49:5 + --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:47:5 | LL | d.s.y = 20; | ^^^^^^^^^^ use of possibly uninitialized `d.s` error[E0381]: assign to part of possibly uninitialized variable: `d` - --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:55:5 + --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:53:5 | LL | d.s.y = 20; | ^^^^^^^^^^ use of possibly uninitialized `d.s` error[E0382]: assign to part of moved value: `d` - --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:62:5 + --> $DIR/issue-21232-partial-init-and-erroneous-use.rs:60:5 | LL | let mut d = D { x: 0, s: S{ y: 0, z: 0} }; | ----- move occurs because `d` has type `D`, which does not implement the `Copy` trait diff --git a/src/test/ui/nll/issue-22323-temp-destruction.rs b/src/test/ui/nll/issue-22323-temp-destruction.rs index 2c547fb7c7d..6357c3ccef1 100644 --- a/src/test/ui/nll/issue-22323-temp-destruction.rs +++ b/src/test/ui/nll/issue-22323-temp-destruction.rs @@ -3,8 +3,6 @@ // compile-pass -#![feature(nll)] - fn main() { let _s = construct().borrow().consume_borrowed(); } diff --git a/src/test/ui/nll/issue-30104.rs b/src/test/ui/nll/issue-30104.rs index 88e49bf8df7..27e519005f6 100644 --- a/src/test/ui/nll/issue-30104.rs +++ b/src/test/ui/nll/issue-30104.rs @@ -2,8 +2,6 @@ // compile-pass -#![feature(nll)] - use std::ops::{Deref, DerefMut}; fn box_two_field(v: &mut Box<(i32, i32)>) { diff --git a/src/test/ui/nll/issue-32382-index-assoc-type-with-lifetime.rs b/src/test/ui/nll/issue-32382-index-assoc-type-with-lifetime.rs index a114d7092ec..7e0ffd6cf36 100644 --- a/src/test/ui/nll/issue-32382-index-assoc-type-with-lifetime.rs +++ b/src/test/ui/nll/issue-32382-index-assoc-type-with-lifetime.rs @@ -1,4 +1,3 @@ -#![feature(nll)] // compile-pass // rust-lang/rust#32382: Borrow checker used to complain about diff --git a/src/test/ui/nll/issue-43058.rs b/src/test/ui/nll/issue-43058.rs index c5bae7a12d7..c50473511f1 100644 --- a/src/test/ui/nll/issue-43058.rs +++ b/src/test/ui/nll/issue-43058.rs @@ -1,7 +1,5 @@ // compile-pass -#![feature(nll)] - use std::borrow::Cow; #[derive(Clone, Debug)] diff --git a/src/test/ui/nll/issue-46589.rs b/src/test/ui/nll/issue-46589.rs index 690f6f269eb..8c0c356e967 100644 --- a/src/test/ui/nll/issue-46589.rs +++ b/src/test/ui/nll/issue-46589.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct Foo; impl Foo { diff --git a/src/test/ui/nll/issue-46589.stderr b/src/test/ui/nll/issue-46589.stderr index 7b02b905303..397909a4366 100644 --- a/src/test/ui/nll/issue-46589.stderr +++ b/src/test/ui/nll/issue-46589.stderr @@ -1,5 +1,5 @@ error[E0499]: cannot borrow `**other` as mutable more than once at a time - --> $DIR/issue-46589.rs:19:21 + --> $DIR/issue-46589.rs:17:21 | LL | *other = match (*other).get_self() { | -------- first mutable borrow occurs here diff --git a/src/test/ui/nll/issue-47022.rs b/src/test/ui/nll/issue-47022.rs index 1add2c334da..3f8e0f5ad3d 100644 --- a/src/test/ui/nll/issue-47022.rs +++ b/src/test/ui/nll/issue-47022.rs @@ -1,8 +1,5 @@ // compile-pass -#![allow(warnings)] -#![feature(nll)] - struct LoadedObject { bodies: Vec, color: Color, diff --git a/src/test/ui/nll/issue-47388.rs b/src/test/ui/nll/issue-47388.rs index df47baa3c17..207af380e62 100644 --- a/src/test/ui/nll/issue-47388.rs +++ b/src/test/ui/nll/issue-47388.rs @@ -1,4 +1,3 @@ -#![feature(nll)] struct FancyNum { num: u8, } diff --git a/src/test/ui/nll/issue-47388.stderr b/src/test/ui/nll/issue-47388.stderr index a5f5bf6ee2f..d4064b3f50a 100644 --- a/src/test/ui/nll/issue-47388.stderr +++ b/src/test/ui/nll/issue-47388.stderr @@ -1,5 +1,5 @@ error[E0594]: cannot assign to `fancy_ref.num` which is behind a `&` reference - --> $DIR/issue-47388.rs:9:5 + --> $DIR/issue-47388.rs:8:5 | LL | let fancy_ref = &(&mut fancy); | ------------- help: consider changing this to be a mutable reference: `&mut (&mut fancy)` diff --git a/src/test/ui/nll/issue-47470.rs b/src/test/ui/nll/issue-47470.rs index 67150b46c35..72ee7f88650 100644 --- a/src/test/ui/nll/issue-47470.rs +++ b/src/test/ui/nll/issue-47470.rs @@ -2,8 +2,6 @@ // causing region relations not to be enforced at all the places where // they have to be enforced. -#![feature(nll)] - struct Foo<'a>(&'a ()); trait Bar { type Assoc; diff --git a/src/test/ui/nll/issue-47470.stderr b/src/test/ui/nll/issue-47470.stderr index d23cee3fc7c..0b1247d60ec 100644 --- a/src/test/ui/nll/issue-47470.stderr +++ b/src/test/ui/nll/issue-47470.stderr @@ -1,5 +1,5 @@ error[E0515]: cannot return reference to local variable `local` - --> $DIR/issue-47470.rs:17:9 + --> $DIR/issue-47470.rs:15:9 | LL | &local | ^^^^^^ returns a reference to data owned by the current function diff --git a/src/test/ui/nll/issue-48070.rs b/src/test/ui/nll/issue-48070.rs index c69bd3dbe90..47426cdfa57 100644 --- a/src/test/ui/nll/issue-48070.rs +++ b/src/test/ui/nll/issue-48070.rs @@ -1,8 +1,6 @@ // run-pass // revisions: lxl nll -#![cfg_attr(nll, feature(nll))] - struct Foo { x: u32 } diff --git a/src/test/ui/nll/issue-48697.rs b/src/test/ui/nll/issue-48697.rs index ececd6fccd8..16e29ab2a8a 100644 --- a/src/test/ui/nll/issue-48697.rs +++ b/src/test/ui/nll/issue-48697.rs @@ -1,7 +1,5 @@ // Regression test for #48697 -#![feature(nll)] - fn foo(x: &i32) -> &i32 { let z = 4; let f = &|y| y; diff --git a/src/test/ui/nll/issue-48697.stderr b/src/test/ui/nll/issue-48697.stderr index 73832fd5787..f0c29b72b42 100644 --- a/src/test/ui/nll/issue-48697.stderr +++ b/src/test/ui/nll/issue-48697.stderr @@ -1,5 +1,5 @@ error[E0515]: cannot return value referencing local variable `z` - --> $DIR/issue-48697.rs:9:5 + --> $DIR/issue-48697.rs:7:5 | LL | let k = f(&z); | -- `z` is borrowed here diff --git a/src/test/ui/nll/issue-50716-1.rs b/src/test/ui/nll/issue-50716-1.rs index d963a620c9a..ec992959a66 100644 --- a/src/test/ui/nll/issue-50716-1.rs +++ b/src/test/ui/nll/issue-50716-1.rs @@ -3,12 +3,8 @@ // bounds derived from `Sized` requirements” that checks that the fixed compiler // accepts this code fragment with both AST and MIR borrow checkers. // -// revisions: migrate nll -// // compile-pass -#![cfg_attr(nll, feature(nll))] - struct Qey(Q); fn main() {} diff --git a/src/test/ui/nll/issue-50716.nll.stderr b/src/test/ui/nll/issue-50716.nll.stderr new file mode 100644 index 00000000000..38dd1b5f6fe --- /dev/null +++ b/src/test/ui/nll/issue-50716.nll.stderr @@ -0,0 +1,11 @@ +error: lifetime may not live long enough + --> $DIR/issue-50716.rs:14:14 + | +LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) + | -- lifetime `'a` defined here +... +LL | let _x = *s; + | ^^ proving this value is `Sized` requires that `'a` must outlive `'static` + +error: aborting due to previous error + diff --git a/src/test/ui/nll/issue-50716.rs b/src/test/ui/nll/issue-50716.rs index ce4bee36656..c2fc345fa2b 100644 --- a/src/test/ui/nll/issue-50716.rs +++ b/src/test/ui/nll/issue-50716.rs @@ -2,8 +2,6 @@ // Regression test for the issue #50716: NLL ignores lifetimes bounds // derived from `Sized` requirements -#![feature(nll)] - trait A { type X: ?Sized; } diff --git a/src/test/ui/nll/issue-50716.stderr b/src/test/ui/nll/issue-50716.stderr index 7e5ffb51501..b19e3a9dfb3 100644 --- a/src/test/ui/nll/issue-50716.stderr +++ b/src/test/ui/nll/issue-50716.stderr @@ -1,11 +1,18 @@ -error: lifetime may not live long enough - --> $DIR/issue-50716.rs:16:14 +error[E0308]: mismatched types + --> $DIR/issue-50716.rs:14:9 + | +LL | let _x = *s; + | ^^ lifetime mismatch + | + = note: expected type `std::marker::Sized` + found type `std::marker::Sized` +note: the lifetime 'a as defined on the function body at 9:8... + --> $DIR/issue-50716.rs:9:8 | LL | fn foo<'a, T: 'static>(s: Box<<&'a T as A>::X>) - | -- lifetime `'a` defined here -... -LL | let _x = *s; - | ^^ proving this value is `Sized` requires that `'a` must outlive `'static` + | ^^ + = note: ...does not necessarily outlive the static lifetime error: aborting due to previous error +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/nll/issue-51191.rs b/src/test/ui/nll/issue-51191.rs index 6704b648699..747bfe3a8a5 100644 --- a/src/test/ui/nll/issue-51191.rs +++ b/src/test/ui/nll/issue-51191.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct Struct; impl Struct { diff --git a/src/test/ui/nll/issue-51191.stderr b/src/test/ui/nll/issue-51191.stderr index e80cd873d5a..e226de15dc2 100644 --- a/src/test/ui/nll/issue-51191.stderr +++ b/src/test/ui/nll/issue-51191.stderr @@ -1,5 +1,5 @@ warning: function cannot return without recursing - --> $DIR/issue-51191.rs:6:5 + --> $DIR/issue-51191.rs:4:5 | LL | fn bar(self: &mut Self) { | ^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing @@ -11,7 +11,7 @@ LL | (&mut self).bar(); = help: a `loop` may express intention better if this is on purpose error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable - --> $DIR/issue-51191.rs:8:9 + --> $DIR/issue-51191.rs:6:9 | LL | (&mut self).bar(); | ^^^^^^^^^^^ @@ -20,7 +20,7 @@ LL | (&mut self).bar(); | try removing `&mut` here error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable - --> $DIR/issue-51191.rs:13:9 + --> $DIR/issue-51191.rs:11:9 | LL | fn imm(self) { | ---- help: consider changing this to be mutable: `mut self` @@ -28,19 +28,19 @@ LL | (&mut self).bar(); | ^^^^^^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable - --> $DIR/issue-51191.rs:22:9 + --> $DIR/issue-51191.rs:20:9 | LL | (&mut self).bar(); | ^^^^^^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow data in a `&` reference as mutable - --> $DIR/issue-51191.rs:22:9 + --> $DIR/issue-51191.rs:20:9 | LL | (&mut self).bar(); | ^^^^^^^^^^^ cannot borrow as mutable error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable - --> $DIR/issue-51191.rs:28:9 + --> $DIR/issue-51191.rs:26:9 | LL | (&mut self).bar(); | ^^^^^^^^^^^ diff --git a/src/test/ui/nll/issue-51244.rs b/src/test/ui/nll/issue-51244.rs index aaf98ddfa27..743415d58af 100644 --- a/src/test/ui/nll/issue-51244.rs +++ b/src/test/ui/nll/issue-51244.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn main() { let ref my_ref @ _ = 0; *my_ref = 0; diff --git a/src/test/ui/nll/issue-51244.stderr b/src/test/ui/nll/issue-51244.stderr index 6b543389af5..8a7e71e0326 100644 --- a/src/test/ui/nll/issue-51244.stderr +++ b/src/test/ui/nll/issue-51244.stderr @@ -1,5 +1,5 @@ error[E0594]: cannot assign to `*my_ref` which is behind a `&` reference - --> $DIR/issue-51244.rs:5:5 + --> $DIR/issue-51244.rs:3:5 | LL | let ref my_ref @ _ = 0; | -------------- help: consider changing this to be a mutable reference: `ref mut my_ref @ _` diff --git a/src/test/ui/nll/issue-51268.rs b/src/test/ui/nll/issue-51268.rs index c14146a3de2..12d0449abb1 100644 --- a/src/test/ui/nll/issue-51268.rs +++ b/src/test/ui/nll/issue-51268.rs @@ -1,7 +1,5 @@ // ignore-tidy-linelength -#![feature(nll)] - struct Bar; impl Bar { diff --git a/src/test/ui/nll/issue-51268.stderr b/src/test/ui/nll/issue-51268.stderr index 0be181745fd..420c94f8e1b 100644 --- a/src/test/ui/nll/issue-51268.stderr +++ b/src/test/ui/nll/issue-51268.stderr @@ -1,5 +1,5 @@ error[E0502]: cannot borrow `self.thing` as mutable because it is also borrowed as immutable - --> $DIR/issue-51268.rs:18:9 + --> $DIR/issue-51268.rs:16:9 | LL | self.thing.bar(|| { | ^ --- -- immutable borrow occurs here diff --git a/src/test/ui/nll/issue-51351.rs b/src/test/ui/nll/issue-51351.rs index 939993f154f..b45477c7fb1 100644 --- a/src/test/ui/nll/issue-51351.rs +++ b/src/test/ui/nll/issue-51351.rs @@ -8,8 +8,6 @@ // // compile-pass -#![feature(nll)] - fn creash<'a>() { let x: &'a () = &(); } diff --git a/src/test/ui/nll/issue-51512.rs b/src/test/ui/nll/issue-51512.rs index 7e2e6e0a16c..691760eb91e 100644 --- a/src/test/ui/nll/issue-51512.rs +++ b/src/test/ui/nll/issue-51512.rs @@ -1,6 +1,3 @@ -#![allow(warnings)] -#![feature(nll)] - fn main() { let range = 0..1; let r = range; diff --git a/src/test/ui/nll/issue-51512.stderr b/src/test/ui/nll/issue-51512.stderr index a84a236ca77..e591ca08290 100644 --- a/src/test/ui/nll/issue-51512.stderr +++ b/src/test/ui/nll/issue-51512.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `range` - --> $DIR/issue-51512.rs:7:13 + --> $DIR/issue-51512.rs:4:13 | LL | let range = 0..1; | ----- move occurs because `range` has type `std::ops::Range`, which does not implement the `Copy` trait diff --git a/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs b/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs index eaa809d2b37..58416c31edd 100644 --- a/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs +++ b/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.rs @@ -4,7 +4,6 @@ // of the fact that the type implements Drop. #![feature(nll)] -#![allow(dead_code)] pub struct S<'a> { url: &'a mut String } diff --git a/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr b/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr index e8741036e1d..34259d06d38 100644 --- a/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr +++ b/src/test/ui/nll/issue-52059-report-when-borrow-and-drop-conflict.stderr @@ -1,5 +1,5 @@ error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:14:5 + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:13:5 | LL | fn finish_1(s: S) -> &mut String { | - has type `S<'1>` @@ -9,7 +9,7 @@ LL | } | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:19:13 + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:18:13 | LL | fn finish_2(s: S) -> &mut String { | - has type `S<'1>` @@ -19,7 +19,7 @@ LL | } | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait error[E0713]: borrow may still be in use when destructor runs - --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:24:21 + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:23:21 | LL | fn finish_3(s: S) -> &mut String { | - has type `S<'1>` @@ -29,7 +29,7 @@ LL | } | - here, drop of `s` needs exclusive access to `*s.url`, because the type `S<'_>` implements the `Drop` trait error[E0509]: cannot move out of type `S<'_>`, which implements the `Drop` trait - --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:29:13 + --> $DIR/issue-52059-report-when-borrow-and-drop-conflict.rs:28:13 | LL | let p = s.url; p | ^^^^^ diff --git a/src/test/ui/nll/issue-52078.rs b/src/test/ui/nll/issue-52078.rs index ebe442adbd9..4b8e6c68075 100644 --- a/src/test/ui/nll/issue-52078.rs +++ b/src/test/ui/nll/issue-52078.rs @@ -1,6 +1,3 @@ -#![feature(nll)] -#![allow(unused_variables)] - // Regression test for #52078: we were failing to infer a relationship // between `'a` and `'b` below due to inference variables introduced // during the normalization process. diff --git a/src/test/ui/nll/issue-52086.rs b/src/test/ui/nll/issue-52086.rs index 78765283ec2..0414428e481 100644 --- a/src/test/ui/nll/issue-52086.rs +++ b/src/test/ui/nll/issue-52086.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - use std::rc::Rc; use std::sync::Arc; diff --git a/src/test/ui/nll/issue-52086.stderr b/src/test/ui/nll/issue-52086.stderr index ed4171ff142..da453fb1f92 100644 --- a/src/test/ui/nll/issue-52086.stderr +++ b/src/test/ui/nll/issue-52086.stderr @@ -1,11 +1,11 @@ error[E0507]: cannot move out of an `Rc` - --> $DIR/issue-52086.rs:10:10 + --> $DIR/issue-52086.rs:8:10 | LL | drop(x.field); | ^^^^^^^ cannot move out of an `Rc` error[E0507]: cannot move out of an `Arc` - --> $DIR/issue-52086.rs:14:10 + --> $DIR/issue-52086.rs:12:10 | LL | drop(y.field); | ^^^^^^^ cannot move out of an `Arc` diff --git a/src/test/ui/nll/issue-52113.rs b/src/test/ui/nll/issue-52113.rs index 795f4f426ff..0d7ee037692 100644 --- a/src/test/ui/nll/issue-52113.rs +++ b/src/test/ui/nll/issue-52113.rs @@ -1,6 +1,3 @@ -// - -#![allow(warnings)] #![feature(nll)] trait Bazinga {} diff --git a/src/test/ui/nll/issue-52113.stderr b/src/test/ui/nll/issue-52113.stderr index 8638fe25769..590963ded78 100644 --- a/src/test/ui/nll/issue-52113.stderr +++ b/src/test/ui/nll/issue-52113.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-52113.rs:37:5 + --> $DIR/issue-52113.rs:34:5 | LL | fn produce_err<'a, 'b: 'a>(data: &'b mut Vec<&'b u32>, value: &'a u32) -> impl Bazinga + 'b { | -- -- lifetime `'b` defined here diff --git a/src/test/ui/nll/issue-52534-1.rs b/src/test/ui/nll/issue-52534-1.rs index 7ab3593c89f..d9ea3ae42c4 100644 --- a/src/test/ui/nll/issue-52534-1.rs +++ b/src/test/ui/nll/issue-52534-1.rs @@ -1,6 +1,3 @@ -#![feature(nll)] -#![allow(warnings)] - struct Test; impl Test { diff --git a/src/test/ui/nll/issue-52534-1.stderr b/src/test/ui/nll/issue-52534-1.stderr index 7d82f5e710f..743179f05c1 100644 --- a/src/test/ui/nll/issue-52534-1.stderr +++ b/src/test/ui/nll/issue-52534-1.stderr @@ -1,17 +1,17 @@ error[E0515]: cannot return reference to local variable `x` - --> $DIR/issue-52534-1.rs:9:9 + --> $DIR/issue-52534-1.rs:6:9 | LL | &x | ^^ returns a reference to data owned by the current function error[E0515]: cannot return reference to local variable `x` - --> $DIR/issue-52534-1.rs:16:5 + --> $DIR/issue-52534-1.rs:13:5 | LL | &x | ^^ returns a reference to data owned by the current function error[E0515]: cannot return value referencing local variable `x` - --> $DIR/issue-52534-1.rs:22:5 + --> $DIR/issue-52534-1.rs:19:5 | LL | &&x | ^-- @@ -20,7 +20,7 @@ LL | &&x | returns a value referencing data owned by the current function error[E0515]: cannot return reference to temporary value - --> $DIR/issue-52534-1.rs:22:5 + --> $DIR/issue-52534-1.rs:19:5 | LL | &&x | ^-- @@ -29,25 +29,25 @@ LL | &&x | returns a reference to data owned by the current function error[E0515]: cannot return reference to local variable `x` - --> $DIR/issue-52534-1.rs:29:5 + --> $DIR/issue-52534-1.rs:26:5 | LL | &x | ^^ returns a reference to data owned by the current function error[E0515]: cannot return reference to local variable `x` - --> $DIR/issue-52534-1.rs:35:5 + --> $DIR/issue-52534-1.rs:32:5 | LL | &x | ^^ returns a reference to data owned by the current function error[E0515]: cannot return reference to local variable `x` - --> $DIR/issue-52534-1.rs:41:5 + --> $DIR/issue-52534-1.rs:38:5 | LL | &x | ^^ returns a reference to data owned by the current function error[E0515]: cannot return reference to local variable `x` - --> $DIR/issue-52534-1.rs:47:5 + --> $DIR/issue-52534-1.rs:44:5 | LL | &x | ^^ returns a reference to data owned by the current function diff --git a/src/test/ui/nll/issue-52534-2.rs b/src/test/ui/nll/issue-52534-2.rs index 6e84869dd6d..e416264ed09 100644 --- a/src/test/ui/nll/issue-52534-2.rs +++ b/src/test/ui/nll/issue-52534-2.rs @@ -1,6 +1,3 @@ -#![feature(nll)] -#![allow(warnings)] - fn foo(x: &u32) -> &u32 { let y; diff --git a/src/test/ui/nll/issue-52534-2.stderr b/src/test/ui/nll/issue-52534-2.stderr index f98deaea718..dd8a87f7e29 100644 --- a/src/test/ui/nll/issue-52534-2.stderr +++ b/src/test/ui/nll/issue-52534-2.stderr @@ -1,5 +1,5 @@ error[E0597]: `x` does not live long enough - --> $DIR/issue-52534-2.rs:9:9 + --> $DIR/issue-52534-2.rs:6:9 | LL | y = &x | ^^^^^^ borrowed value does not live long enough diff --git a/src/test/ui/nll/issue-52534.rs b/src/test/ui/nll/issue-52534.rs index 1394560df19..559d4c8591b 100644 --- a/src/test/ui/nll/issue-52534.rs +++ b/src/test/ui/nll/issue-52534.rs @@ -1,6 +1,3 @@ -#![feature(nll)] -#![allow(warnings)] - fn foo(_: impl FnOnce(&u32) -> &u32) { } diff --git a/src/test/ui/nll/issue-52534.stderr b/src/test/ui/nll/issue-52534.stderr index 9ac79eda161..b2b727fd438 100644 --- a/src/test/ui/nll/issue-52534.stderr +++ b/src/test/ui/nll/issue-52534.stderr @@ -1,5 +1,5 @@ error[E0597]: `x` does not live long enough - --> $DIR/issue-52534.rs:12:14 + --> $DIR/issue-52534.rs:9:14 | LL | foo(|a| &x) | - ^ `x` would have to be valid for `'0`... @@ -13,7 +13,7 @@ LL | } = note: to learn more, visit error[E0597]: `y` does not live long enough - --> $DIR/issue-52534.rs:18:26 + --> $DIR/issue-52534.rs:15:26 | LL | baz(|first, second| &y) | ----- ^ `y` would have to be valid for `'0`... diff --git a/src/test/ui/nll/issue-52663-span-decl-captured-variable.rs b/src/test/ui/nll/issue-52663-span-decl-captured-variable.rs index 3e57d26745a..24a4267f653 100644 --- a/src/test/ui/nll/issue-52663-span-decl-captured-variable.rs +++ b/src/test/ui/nll/issue-52663-span-decl-captured-variable.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn expect_fn(f: F) where F : Fn() { f(); } diff --git a/src/test/ui/nll/issue-52663-span-decl-captured-variable.stderr b/src/test/ui/nll/issue-52663-span-decl-captured-variable.stderr index 0162c6bcbd1..8958bdf4c2a 100644 --- a/src/test/ui/nll/issue-52663-span-decl-captured-variable.stderr +++ b/src/test/ui/nll/issue-52663-span-decl-captured-variable.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/issue-52663-span-decl-captured-variable.rs:10:26 + --> $DIR/issue-52663-span-decl-captured-variable.rs:8:26 | LL | let x = (vec![22], vec![44]); | - captured outer variable diff --git a/src/test/ui/nll/issue-52663-trait-object.rs b/src/test/ui/nll/issue-52663-trait-object.rs index 121c3ef4e61..e8e571aadc3 100644 --- a/src/test/ui/nll/issue-52663-trait-object.rs +++ b/src/test/ui/nll/issue-52663-trait-object.rs @@ -1,5 +1,4 @@ #![feature(box_syntax)] -#![feature(nll)] trait Foo { fn get(&self); } diff --git a/src/test/ui/nll/issue-52663-trait-object.stderr b/src/test/ui/nll/issue-52663-trait-object.stderr index b9437d88ff6..9262117f397 100644 --- a/src/test/ui/nll/issue-52663-trait-object.stderr +++ b/src/test/ui/nll/issue-52663-trait-object.stderr @@ -1,5 +1,5 @@ error[E0597]: `tmp0` does not live long enough - --> $DIR/issue-52663-trait-object.rs:13:20 + --> $DIR/issue-52663-trait-object.rs:12:20 | LL | let tmp1 = &tmp0; | ^^^^^ borrowed value does not live long enough diff --git a/src/test/ui/nll/issue-52669.rs b/src/test/ui/nll/issue-52669.rs index 6027e988141..e33528ac59e 100644 --- a/src/test/ui/nll/issue-52669.rs +++ b/src/test/ui/nll/issue-52669.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct A { b: B, } diff --git a/src/test/ui/nll/issue-52669.stderr b/src/test/ui/nll/issue-52669.stderr index f51768c3859..db53e444b9e 100644 --- a/src/test/ui/nll/issue-52669.stderr +++ b/src/test/ui/nll/issue-52669.stderr @@ -1,5 +1,5 @@ error[E0382]: borrow of moved value: `a.b` - --> $DIR/issue-52669.rs:15:5 + --> $DIR/issue-52669.rs:13:5 | LL | fn bar(mut a: A) -> B { | ----- move occurs because `a` has type `A`, which does not implement the `Copy` trait diff --git a/src/test/ui/nll/issue-52742.nll.stderr b/src/test/ui/nll/issue-52742.nll.stderr new file mode 100644 index 00000000000..e8b7b3333eb --- /dev/null +++ b/src/test/ui/nll/issue-52742.nll.stderr @@ -0,0 +1,12 @@ +error: lifetime may not live long enough + --> $DIR/issue-52742.rs:14:9 + | +LL | fn take_bar(&mut self, b: Bar<'_>) { + | --------- -- let's call this `'1` + | | + | has type `&mut Foo<'_, '2>` +LL | self.y = b.z + | ^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2` + +error: aborting due to previous error + diff --git a/src/test/ui/nll/issue-52742.rs b/src/test/ui/nll/issue-52742.rs index 150e67fe094..db9ddfff285 100644 --- a/src/test/ui/nll/issue-52742.rs +++ b/src/test/ui/nll/issue-52742.rs @@ -1,4 +1,3 @@ -#![feature(nll)] #![feature(in_band_lifetimes)] struct Foo<'a, 'b> { @@ -13,7 +12,7 @@ struct Bar<'b> { impl Foo<'_, '_> { fn take_bar(&mut self, b: Bar<'_>) { self.y = b.z - //~^ ERROR lifetime may not live long enough + //~^ ERROR } } diff --git a/src/test/ui/nll/issue-52742.stderr b/src/test/ui/nll/issue-52742.stderr index 6b25296c4bd..b9829158002 100644 --- a/src/test/ui/nll/issue-52742.stderr +++ b/src/test/ui/nll/issue-52742.stderr @@ -1,12 +1,22 @@ -error: lifetime may not live long enough - --> $DIR/issue-52742.rs:15:9 +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/issue-52742.rs:14:18 | -LL | fn take_bar(&mut self, b: Bar<'_>) { - | --------- -- let's call this `'1` - | | - | has type `&mut Foo<'_, '2>` LL | self.y = b.z - | ^^^^^^^^^^^^ assignment requires that `'1` must outlive `'2` + | ^^^ + | +note: ...the reference is valid for the lifetime '_ as defined on the impl at 12:10... + --> $DIR/issue-52742.rs:12:10 + | +LL | impl Foo<'_, '_> { + | ^^ +note: ...but the borrowed content is only valid for the anonymous lifetime #2 defined on the method body at 13:5 + --> $DIR/issue-52742.rs:13:5 + | +LL | / fn take_bar(&mut self, b: Bar<'_>) { +LL | | self.y = b.z +LL | | +LL | | } + | |_____^ error: aborting due to previous error diff --git a/src/test/ui/nll/issue-53119.rs b/src/test/ui/nll/issue-53119.rs index 97e05c8810d..7a47a77f6bb 100644 --- a/src/test/ui/nll/issue-53119.rs +++ b/src/test/ui/nll/issue-53119.rs @@ -1,7 +1,5 @@ // compile-pass -#![feature(nll)] - use std::ops::Deref; pub struct TypeFieldIterator<'a, T: 'a> { diff --git a/src/test/ui/nll/issue-53570.rs b/src/test/ui/nll/issue-53570.rs index d0baffa2702..cea458dcb65 100644 --- a/src/test/ui/nll/issue-53570.rs +++ b/src/test/ui/nll/issue-53570.rs @@ -8,10 +8,6 @@ // // compile-pass -#![feature(nll)] -#![feature(rustc_attrs)] -#![allow(dead_code)] - use std::cell::{RefCell, Ref}; trait AnyVec<'a> { diff --git a/src/test/ui/nll/issue-55288.rs b/src/test/ui/nll/issue-55288.rs index 9b3eb7f05de..c7b6ac59248 100644 --- a/src/test/ui/nll/issue-55288.rs +++ b/src/test/ui/nll/issue-55288.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // run-pass struct Slice(&'static [&'static [u8]]); diff --git a/src/test/ui/nll/issue-55344.rs b/src/test/ui/nll/issue-55344.rs index b900acfa159..521d4d33d86 100644 --- a/src/test/ui/nll/issue-55344.rs +++ b/src/test/ui/nll/issue-55344.rs @@ -1,7 +1,5 @@ // compile-pass -#![feature(nll)] -#![allow(unreachable_code)] #![deny(unused_mut)] pub fn foo() { diff --git a/src/test/ui/nll/issue-55394.nll.stderr b/src/test/ui/nll/issue-55394.nll.stderr new file mode 100644 index 00000000000..d0723047ac0 --- /dev/null +++ b/src/test/ui/nll/issue-55394.nll.stderr @@ -0,0 +1,12 @@ +error: lifetime may not live long enough + --> $DIR/issue-55394.rs:9:9 + | +LL | fn new(bar: &mut Bar) -> Self { + | - ---- return type is Foo<'2> + | | + | let's call the lifetime of this reference `'1` +LL | Foo { bar } + | ^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2` + +error: aborting due to previous error + diff --git a/src/test/ui/nll/issue-55394.rs b/src/test/ui/nll/issue-55394.rs index deb1034525e..f813d1c915c 100644 --- a/src/test/ui/nll/issue-55394.rs +++ b/src/test/ui/nll/issue-55394.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct Bar; struct Foo<'s> { @@ -8,7 +6,7 @@ struct Foo<'s> { impl Foo<'_> { fn new(bar: &mut Bar) -> Self { - Foo { bar } //~ERROR lifetime may not live long enough + Foo { bar } //~ERROR } } diff --git a/src/test/ui/nll/issue-55394.stderr b/src/test/ui/nll/issue-55394.stderr index e9a70fd6b16..ffb94ed7dd7 100644 --- a/src/test/ui/nll/issue-55394.stderr +++ b/src/test/ui/nll/issue-55394.stderr @@ -1,12 +1,29 @@ -error: lifetime may not live long enough - --> $DIR/issue-55394.rs:11:9 +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'s` due to conflicting requirements + --> $DIR/issue-55394.rs:9:9 | -LL | fn new(bar: &mut Bar) -> Self { - | - ---- return type is Foo<'2> - | | - | let's call the lifetime of this reference `'1` LL | Foo { bar } - | ^^^^^^^^^^^ returning this value requires that `'1` must outlive `'2` + | ^^^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 8:5... + --> $DIR/issue-55394.rs:8:5 + | +LL | / fn new(bar: &mut Bar) -> Self { +LL | | Foo { bar } +LL | | } + | |_____^ +note: ...so that reference does not outlive borrowed content + --> $DIR/issue-55394.rs:9:15 + | +LL | Foo { bar } + | ^^^ +note: but, the lifetime must be valid for the lifetime '_ as defined on the impl at 7:10... + --> $DIR/issue-55394.rs:7:10 + | +LL | impl Foo<'_> { + | ^^ + = note: ...so that the expression is assignable: + expected Foo<'_> + found Foo<'_> error: aborting due to previous error diff --git a/src/test/ui/nll/issue-55401.nll.stderr b/src/test/ui/nll/issue-55401.nll.stderr new file mode 100644 index 00000000000..4f797f26a1a --- /dev/null +++ b/src/test/ui/nll/issue-55401.nll.stderr @@ -0,0 +1,11 @@ +error: lifetime may not live long enough + --> $DIR/issue-55401.rs:3:5 + | +LL | fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 { + | -- lifetime `'a` defined here +LL | let (ref y, _z): (&'a u32, u32) = (&22, 44); +LL | *y + | ^^ returning this value requires that `'a` must outlive `'static` + +error: aborting due to previous error + diff --git a/src/test/ui/nll/issue-55401.rs b/src/test/ui/nll/issue-55401.rs index 2fa23449108..fc45824e903 100644 --- a/src/test/ui/nll/issue-55401.rs +++ b/src/test/ui/nll/issue-55401.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 { let (ref y, _z): (&'a u32, u32) = (&22, 44); *y //~ ERROR diff --git a/src/test/ui/nll/issue-55401.stderr b/src/test/ui/nll/issue-55401.stderr index 622bc5a3f34..50debc6386f 100644 --- a/src/test/ui/nll/issue-55401.stderr +++ b/src/test/ui/nll/issue-55401.stderr @@ -1,11 +1,15 @@ -error: lifetime may not live long enough - --> $DIR/issue-55401.rs:5:5 +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/issue-55401.rs:3:5 + | +LL | *y + | ^^ + | + = note: ...the reference is valid for the static lifetime... +note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 1:47 + --> $DIR/issue-55401.rs:1:47 | LL | fn static_to_a_to_static_through_ref_in_tuple<'a>(x: &'a u32) -> &'static u32 { - | -- lifetime `'a` defined here -LL | let (ref y, _z): (&'a u32, u32) = (&22, 44); -LL | *y - | ^^ returning this value requires that `'a` must outlive `'static` + | ^^ error: aborting due to previous error diff --git a/src/test/ui/nll/issue-57265-return-type-wf-check.rs b/src/test/ui/nll/issue-57265-return-type-wf-check.rs index 24c61a4926f..8fb8351cee2 100644 --- a/src/test/ui/nll/issue-57265-return-type-wf-check.rs +++ b/src/test/ui/nll/issue-57265-return-type-wf-check.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - use std::any::Any; #[derive(Debug, Clone)] diff --git a/src/test/ui/nll/issue-57265-return-type-wf-check.stderr b/src/test/ui/nll/issue-57265-return-type-wf-check.stderr index db01212597f..20add62b91d 100644 --- a/src/test/ui/nll/issue-57265-return-type-wf-check.stderr +++ b/src/test/ui/nll/issue-57265-return-type-wf-check.stderr @@ -1,5 +1,5 @@ error[E0716]: temporary value dropped while borrowed - --> $DIR/issue-57265-return-type-wf-check.rs:22:23 + --> $DIR/issue-57265-return-type-wf-check.rs:20:23 | LL | let (_, z) = foo(&"hello".to_string()); | -----^^^^^^^^^^^^^^^^^^^-- temporary value is freed at the end of this statement diff --git a/src/test/ui/nll/issue-57280-1.rs b/src/test/ui/nll/issue-57280-1.rs index 356c477f1ba..e02d6a0cb5a 100644 --- a/src/test/ui/nll/issue-57280-1.rs +++ b/src/test/ui/nll/issue-57280-1.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // compile-pass trait Foo<'a> { diff --git a/src/test/ui/nll/issue-57280.rs b/src/test/ui/nll/issue-57280.rs index 4fe6a96f5dc..776a0d359cd 100644 --- a/src/test/ui/nll/issue-57280.rs +++ b/src/test/ui/nll/issue-57280.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // compile-pass trait Foo { diff --git a/src/test/ui/nll/issue-57989.rs b/src/test/ui/nll/issue-57989.rs index 4f21cca97cc..c410f0b0bfb 100644 --- a/src/test/ui/nll/issue-57989.rs +++ b/src/test/ui/nll/issue-57989.rs @@ -1,7 +1,5 @@ // Test for ICE from issue 57989 -#![feature(nll)] - fn f(x: &i32) { let g = &x; *x = 0; //~ ERROR cannot assign to `*x` which is behind a `&` reference diff --git a/src/test/ui/nll/issue-57989.stderr b/src/test/ui/nll/issue-57989.stderr index 7367dc095a3..00a9bab4868 100644 --- a/src/test/ui/nll/issue-57989.stderr +++ b/src/test/ui/nll/issue-57989.stderr @@ -1,5 +1,5 @@ error[E0594]: cannot assign to `*x` which is behind a `&` reference - --> $DIR/issue-57989.rs:7:5 + --> $DIR/issue-57989.rs:5:5 | LL | fn f(x: &i32) { | ---- help: consider changing this to be a mutable reference: `&mut i32` @@ -8,7 +8,7 @@ LL | *x = 0; | ^^^^^^ `x` is a `&` reference, so the data it refers to cannot be written error[E0506]: cannot assign to `*x` because it is borrowed - --> $DIR/issue-57989.rs:7:5 + --> $DIR/issue-57989.rs:5:5 | LL | let g = &x; | -- borrow of `*x` occurs here diff --git a/src/test/ui/nll/issue-58053.rs b/src/test/ui/nll/issue-58053.rs index d4338905ed2..0992e3a85ae 100644 --- a/src/test/ui/nll/issue-58053.rs +++ b/src/test/ui/nll/issue-58053.rs @@ -1,4 +1,3 @@ -#![allow(warnings)] #![feature(nll)] fn main() { diff --git a/src/test/ui/nll/issue-58053.stderr b/src/test/ui/nll/issue-58053.stderr index 9048983318b..297681ff403 100644 --- a/src/test/ui/nll/issue-58053.stderr +++ b/src/test/ui/nll/issue-58053.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-58053.rs:7:33 + --> $DIR/issue-58053.rs:6:33 | LL | let f = |x: &i32| -> &i32 { x }; | - ---- ^ returning this value requires that `'1` must outlive `'2` @@ -8,7 +8,7 @@ LL | let f = |x: &i32| -> &i32 { x }; | let's call the lifetime of this reference `'1` error: lifetime may not live long enough - --> $DIR/issue-58053.rs:11:25 + --> $DIR/issue-58053.rs:10:25 | LL | let g = |x: &i32| { x }; | - - ^ returning this value requires that `'1` must outlive `'2` diff --git a/src/test/ui/nll/issue-58299.rs b/src/test/ui/nll/issue-58299.rs index 9267cac5dd3..3277a9db8ec 100644 --- a/src/test/ui/nll/issue-58299.rs +++ b/src/test/ui/nll/issue-58299.rs @@ -1,4 +1,3 @@ -#![allow(dead_code)] #![feature(nll)] struct A<'a>(&'a ()); diff --git a/src/test/ui/nll/issue-58299.stderr b/src/test/ui/nll/issue-58299.stderr index 0c69b70a97c..aba07542d02 100644 --- a/src/test/ui/nll/issue-58299.stderr +++ b/src/test/ui/nll/issue-58299.stderr @@ -1,5 +1,5 @@ error: lifetime may not live long enough - --> $DIR/issue-58299.rs:17:9 + --> $DIR/issue-58299.rs:16:9 | LL | fn foo<'a>(x: i32) { | -- lifetime `'a` defined here @@ -8,7 +8,7 @@ LL | A::<'a>::X..=A::<'static>::X => (), | ^^^^^^^^^^ requires that `'a` must outlive `'static` error: lifetime may not live long enough - --> $DIR/issue-58299.rs:25:27 + --> $DIR/issue-58299.rs:24:27 | LL | fn bar<'a>(x: i32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.rs b/src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.rs index 5b609820a23..1de32ddf531 100644 --- a/src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.rs +++ b/src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.rs @@ -1,6 +1,3 @@ -#![allow(warnings)] -#![feature(nll)] - struct Wrap<'p> { p: &'p mut i32 } impl<'p> Drop for Wrap<'p> { diff --git a/src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.stderr b/src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.stderr index e7755bdb89c..80e29780746 100644 --- a/src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.stderr +++ b/src/test/ui/nll/maybe-initialized-drop-implicit-fragment-drop.stderr @@ -1,5 +1,5 @@ error[E0506]: cannot assign to `x` because it is borrowed - --> $DIR/maybe-initialized-drop-implicit-fragment-drop.rs:20:5 + --> $DIR/maybe-initialized-drop-implicit-fragment-drop.rs:17:5 | LL | let wrap = Wrap { p: &mut x }; | ------ borrow of `x` occurs here diff --git a/src/test/ui/nll/move-errors.rs b/src/test/ui/nll/move-errors.rs index a3416373709..e0fcd625032 100644 --- a/src/test/ui/nll/move-errors.rs +++ b/src/test/ui/nll/move-errors.rs @@ -1,6 +1,3 @@ -#![allow(unused)] -#![feature(nll)] - struct A(String); struct C(D); diff --git a/src/test/ui/nll/move-errors.stderr b/src/test/ui/nll/move-errors.stderr index bb30da034af..a4af11e3d40 100644 --- a/src/test/ui/nll/move-errors.stderr +++ b/src/test/ui/nll/move-errors.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of borrowed content - --> $DIR/move-errors.rs:9:13 + --> $DIR/move-errors.rs:6:13 | LL | let b = *a; | ^^ @@ -8,7 +8,7 @@ LL | let b = *a; | help: consider removing the `*`: `a` error[E0508]: cannot move out of type `[A; 1]`, a non-copy array - --> $DIR/move-errors.rs:15:13 + --> $DIR/move-errors.rs:12:13 | LL | let b = a[0]; | ^^^^ @@ -17,7 +17,7 @@ LL | let b = a[0]; | help: consider borrowing here: `&a[0]` error[E0507]: cannot move out of borrowed content - --> $DIR/move-errors.rs:22:13 + --> $DIR/move-errors.rs:19:13 | LL | let s = **r; | ^^^ @@ -26,7 +26,7 @@ LL | let s = **r; | help: consider removing the `*`: `*r` error[E0507]: cannot move out of an `Rc` - --> $DIR/move-errors.rs:30:13 + --> $DIR/move-errors.rs:27:13 | LL | let s = *r; | ^^ @@ -35,7 +35,7 @@ LL | let s = *r; | help: consider removing the `*`: `r` error[E0508]: cannot move out of type `[A; 1]`, a non-copy array - --> $DIR/move-errors.rs:35:13 + --> $DIR/move-errors.rs:32:13 | LL | let a = [A("".to_string())][0]; | ^^^^^^^^^^^^^^^^^^^^^^ @@ -44,7 +44,7 @@ LL | let a = [A("".to_string())][0]; | help: consider borrowing here: `&[A("".to_string())][0]` error[E0507]: cannot move out of borrowed content - --> $DIR/move-errors.rs:41:16 + --> $DIR/move-errors.rs:38:16 | LL | let A(s) = *a; | - ^^ @@ -54,13 +54,13 @@ LL | let A(s) = *a; | data moved here | note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait - --> $DIR/move-errors.rs:41:11 + --> $DIR/move-errors.rs:38:11 | LL | let A(s) = *a; | ^ error[E0509]: cannot move out of type `D`, which implements the `Drop` trait - --> $DIR/move-errors.rs:47:19 + --> $DIR/move-errors.rs:44:19 | LL | let C(D(s)) = c; | - ^ cannot move out of here @@ -68,19 +68,19 @@ LL | let C(D(s)) = c; | data moved here | note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait - --> $DIR/move-errors.rs:47:13 + --> $DIR/move-errors.rs:44:13 | LL | let C(D(s)) = c; | ^ error[E0507]: cannot move out of borrowed content - --> $DIR/move-errors.rs:54:9 + --> $DIR/move-errors.rs:51:9 | LL | b = *a; | ^^ cannot move out of borrowed content error[E0508]: cannot move out of type `[B; 1]`, a non-copy array - --> $DIR/move-errors.rs:77:11 + --> $DIR/move-errors.rs:74:11 | LL | match x[0] { | ^^^^ @@ -94,7 +94,7 @@ LL | B::V(s) => (), | - ...and here | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/move-errors.rs:79:14 + --> $DIR/move-errors.rs:76:14 | LL | B::U(d) => (), | ^ @@ -102,7 +102,7 @@ LL | B::V(s) => (), | ^ error[E0509]: cannot move out of type `D`, which implements the `Drop` trait - --> $DIR/move-errors.rs:86:11 + --> $DIR/move-errors.rs:83:11 | LL | match x { | ^ cannot move out of here @@ -111,13 +111,13 @@ LL | B::U(D(s)) => (), | - data moved here | note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait - --> $DIR/move-errors.rs:89:16 + --> $DIR/move-errors.rs:86:16 | LL | B::U(D(s)) => (), | ^ error[E0509]: cannot move out of type `D`, which implements the `Drop` trait - --> $DIR/move-errors.rs:95:11 + --> $DIR/move-errors.rs:92:11 | LL | match x { | ^ cannot move out of here @@ -126,13 +126,13 @@ LL | (D(s), &t) => (), | - data moved here | note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait - --> $DIR/move-errors.rs:98:12 + --> $DIR/move-errors.rs:95:12 | LL | (D(s), &t) => (), | ^ error[E0507]: cannot move out of borrowed content - --> $DIR/move-errors.rs:95:11 + --> $DIR/move-errors.rs:92:11 | LL | match x { | ^ cannot move out of borrowed content @@ -141,13 +141,13 @@ LL | (D(s), &t) => (), | - data moved here | note: move occurs because `t` has type `std::string::String`, which does not implement the `Copy` trait - --> $DIR/move-errors.rs:98:17 + --> $DIR/move-errors.rs:95:17 | LL | (D(s), &t) => (), | ^ error[E0509]: cannot move out of type `F`, which implements the `Drop` trait - --> $DIR/move-errors.rs:105:11 + --> $DIR/move-errors.rs:102:11 | LL | match x { | ^ cannot move out of here @@ -158,13 +158,13 @@ LL | F(s, mut t) => (), | data moved here | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/move-errors.rs:107:11 + --> $DIR/move-errors.rs:104:11 | LL | F(s, mut t) => (), | ^ ^^^^^ error[E0507]: cannot move out of borrowed content - --> $DIR/move-errors.rs:113:11 + --> $DIR/move-errors.rs:110:11 | LL | match *x { | ^^ @@ -176,7 +176,7 @@ LL | Ok(s) | Err(s) => (), | - data moved here | note: move occurs because `s` has type `std::string::String`, which does not implement the `Copy` trait - --> $DIR/move-errors.rs:115:12 + --> $DIR/move-errors.rs:112:12 | LL | Ok(s) | Err(s) => (), | ^ diff --git a/src/test/ui/nll/move-subpaths-moves-root.rs b/src/test/ui/nll/move-subpaths-moves-root.rs index 72a36ef22df..e7caf89e783 100644 --- a/src/test/ui/nll/move-subpaths-moves-root.rs +++ b/src/test/ui/nll/move-subpaths-moves-root.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn main() { let x = (vec![1, 2, 3], ); drop(x.0); diff --git a/src/test/ui/nll/move-subpaths-moves-root.stderr b/src/test/ui/nll/move-subpaths-moves-root.stderr index bdbc25e9ee3..7030d5b3305 100644 --- a/src/test/ui/nll/move-subpaths-moves-root.stderr +++ b/src/test/ui/nll/move-subpaths-moves-root.stderr @@ -1,5 +1,5 @@ error[E0382]: use of moved value: `x` - --> $DIR/move-subpaths-moves-root.rs:6:10 + --> $DIR/move-subpaths-moves-root.rs:4:10 | LL | drop(x.0); | --- value moved here diff --git a/src/test/ui/nll/normalization-bounds-error.rs b/src/test/ui/nll/normalization-bounds-error.rs index d6610e15823..b6cfcd98732 100644 --- a/src/test/ui/nll/normalization-bounds-error.rs +++ b/src/test/ui/nll/normalization-bounds-error.rs @@ -1,7 +1,6 @@ // Check that we error when a bound from the impl is not satisfied when // normalizing an associated type. -#![feature(nll)] trait Visitor<'d> { type Value; } diff --git a/src/test/ui/nll/normalization-bounds-error.stderr b/src/test/ui/nll/normalization-bounds-error.stderr index 8ee00168661..951e73e7fd7 100644 --- a/src/test/ui/nll/normalization-bounds-error.stderr +++ b/src/test/ui/nll/normalization-bounds-error.stderr @@ -1,16 +1,16 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'d` due to conflicting requirements - --> $DIR/normalization-bounds-error.rs:13:1 + --> $DIR/normalization-bounds-error.rs:12:1 | LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -note: first, the lifetime cannot outlive the lifetime 'd as defined on the function body at 13:14... - --> $DIR/normalization-bounds-error.rs:13:14 +note: first, the lifetime cannot outlive the lifetime 'd as defined on the function body at 12:14... + --> $DIR/normalization-bounds-error.rs:12:14 | LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {} | ^^ -note: ...but the lifetime must also be valid for the lifetime 'a as defined on the function body at 13:18... - --> $DIR/normalization-bounds-error.rs:13:18 +note: ...but the lifetime must also be valid for the lifetime 'a as defined on the function body at 12:18... + --> $DIR/normalization-bounds-error.rs:12:18 | LL | fn visit_seq<'d, 'a: 'd>() -> <&'a () as Visitor<'d>>::Value {} | ^^ diff --git a/src/test/ui/nll/normalization-bounds.rs b/src/test/ui/nll/normalization-bounds.rs index ebc19d7cc83..5d2825ef2d6 100644 --- a/src/test/ui/nll/normalization-bounds.rs +++ b/src/test/ui/nll/normalization-bounds.rs @@ -2,7 +2,6 @@ //run-pass -#![feature(nll)] trait Visitor<'d> { type Value; } diff --git a/src/test/ui/nll/promotable-mutable-zst-doesnt-conflict.rs b/src/test/ui/nll/promotable-mutable-zst-doesnt-conflict.rs index 061d0d69d09..6d5bdfa4da2 100644 --- a/src/test/ui/nll/promotable-mutable-zst-doesnt-conflict.rs +++ b/src/test/ui/nll/promotable-mutable-zst-doesnt-conflict.rs @@ -3,8 +3,6 @@ // run-pass -#![feature(nll)] - pub fn main() { let mut x: Vec<&[i32; 0]> = Vec::new(); for i in 0..10 { diff --git a/src/test/ui/nll/promoted-bounds.rs b/src/test/ui/nll/promoted-bounds.rs index 59b21cf9ac2..5f95ae13c58 100644 --- a/src/test/ui/nll/promoted-bounds.rs +++ b/src/test/ui/nll/promoted-bounds.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - fn shorten_lifetime<'a, 'b, 'min>(a: &'a i32, b: &'b i32) -> &'min i32 where 'a: 'min, diff --git a/src/test/ui/nll/promoted-bounds.stderr b/src/test/ui/nll/promoted-bounds.stderr index de185cc0d29..df347f4e7f0 100644 --- a/src/test/ui/nll/promoted-bounds.stderr +++ b/src/test/ui/nll/promoted-bounds.stderr @@ -1,5 +1,5 @@ error[E0597]: `l` does not live long enough - --> $DIR/promoted-bounds.rs:21:17 + --> $DIR/promoted-bounds.rs:19:17 | LL | let ptr = { | --- borrow later stored here diff --git a/src/test/ui/nll/promoted-closure-pair.rs b/src/test/ui/nll/promoted-closure-pair.rs index 7b3bbad4c1e..cc9f17fd4e6 100644 --- a/src/test/ui/nll/promoted-closure-pair.rs +++ b/src/test/ui/nll/promoted-closure-pair.rs @@ -1,7 +1,5 @@ // Check that we handle multiple closures in the same promoted constant. -#![feature(nll)] - fn foo() -> &'static i32 { let z = 0; let p = &(|y| y, |y| y); diff --git a/src/test/ui/nll/promoted-closure-pair.stderr b/src/test/ui/nll/promoted-closure-pair.stderr index b04d1a9ccba..000bdf85804 100644 --- a/src/test/ui/nll/promoted-closure-pair.stderr +++ b/src/test/ui/nll/promoted-closure-pair.stderr @@ -1,5 +1,5 @@ error[E0515]: cannot return value referencing local variable `z` - --> $DIR/promoted-closure-pair.rs:9:5 + --> $DIR/promoted-closure-pair.rs:7:5 | LL | p.1(&z) | ^^^^--^ diff --git a/src/test/ui/nll/relate_tys/issue-48071.rs b/src/test/ui/nll/relate_tys/issue-48071.rs index 9b8ac167466..72987629848 100644 --- a/src/test/ui/nll/relate_tys/issue-48071.rs +++ b/src/test/ui/nll/relate_tys/issue-48071.rs @@ -6,10 +6,6 @@ // // compile-pass -#![allow(warnings)] -#![feature(dyn_trait)] -#![feature(nll)] - trait Foo { fn foo(&self) { } } diff --git a/src/test/ui/nll/relate_tys/var-appears-twice.rs b/src/test/ui/nll/relate_tys/var-appears-twice.rs index 2f227c87259..77129f4468f 100644 --- a/src/test/ui/nll/relate_tys/var-appears-twice.rs +++ b/src/test/ui/nll/relate_tys/var-appears-twice.rs @@ -2,9 +2,6 @@ // function returning always its first argument can be upcast to one // that returns either first or second argument. -#![feature(nll)] -#![allow(warnings)] - use std::cell::Cell; type DoubleCell = Cell<(A, A)>; diff --git a/src/test/ui/nll/relate_tys/var-appears-twice.stderr b/src/test/ui/nll/relate_tys/var-appears-twice.stderr index 7c078d226dc..d032ce6f213 100644 --- a/src/test/ui/nll/relate_tys/var-appears-twice.stderr +++ b/src/test/ui/nll/relate_tys/var-appears-twice.stderr @@ -1,5 +1,5 @@ error[E0597]: `b` does not live long enough - --> $DIR/var-appears-twice.rs:23:38 + --> $DIR/var-appears-twice.rs:20:38 | LL | let x: DoubleCell<_> = make_cell(&b); | ------------- ^^ borrowed value does not live long enough diff --git a/src/test/ui/nll/return-ref-mut-issue-46557.rs b/src/test/ui/nll/return-ref-mut-issue-46557.rs index b535ab1f5e1..dca61d39dfe 100644 --- a/src/test/ui/nll/return-ref-mut-issue-46557.rs +++ b/src/test/ui/nll/return-ref-mut-issue-46557.rs @@ -1,8 +1,5 @@ // Regression test for issue #46557 -#![feature(nll)] -#![allow(dead_code)] - fn gimme_static_mut() -> &'static mut u32 { let ref mut x = 1234543; x //~ ERROR cannot return value referencing temporary value [E0515] diff --git a/src/test/ui/nll/return-ref-mut-issue-46557.stderr b/src/test/ui/nll/return-ref-mut-issue-46557.stderr index cc201136ff2..720440a0ae5 100644 --- a/src/test/ui/nll/return-ref-mut-issue-46557.stderr +++ b/src/test/ui/nll/return-ref-mut-issue-46557.stderr @@ -1,5 +1,5 @@ error[E0515]: cannot return value referencing temporary value - --> $DIR/return-ref-mut-issue-46557.rs:8:5 + --> $DIR/return-ref-mut-issue-46557.rs:5:5 | LL | let ref mut x = 1234543; | ------- temporary value created here diff --git a/src/test/ui/nll/ty-outlives/issue-53789-1.rs b/src/test/ui/nll/ty-outlives/issue-53789-1.rs index 586f076c8ca..dc67c1a68aa 100644 --- a/src/test/ui/nll/ty-outlives/issue-53789-1.rs +++ b/src/test/ui/nll/ty-outlives/issue-53789-1.rs @@ -2,9 +2,6 @@ // // compile-pass -#![feature(nll)] -#![allow(unused_variables)] - use std::collections::BTreeMap; trait ValueTree { diff --git a/src/test/ui/nll/ty-outlives/issue-53789-2.rs b/src/test/ui/nll/ty-outlives/issue-53789-2.rs index de8b05aeed7..1b80be2eaff 100644 --- a/src/test/ui/nll/ty-outlives/issue-53789-2.rs +++ b/src/test/ui/nll/ty-outlives/issue-53789-2.rs @@ -2,9 +2,6 @@ // // compile-pass -#![feature(nll)] -#![allow(unused_variables)] - use std::collections::BTreeMap; use std::ops::Range; use std::cmp::Ord; diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.nll.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.nll.stderr new file mode 100644 index 00000000000..3a84cbfbedc --- /dev/null +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.nll.stderr @@ -0,0 +1,11 @@ +error[E0309]: the associated type `>::Output` may not live long enough + --> $DIR/projection-where-clause-env-wrong-bound.rs:15:5 + | +LL | bar::() + | ^^^^^^^^^^^^^^^^ + | + = help: consider adding an explicit lifetime bound `>::Output: 'a`... + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs index 9c2cbfd4a45..dce88b88c75 100644 --- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // Test that we are able to establish that `>::Output` outlives `'b` here. We need to prove however // that `>::Output` outlives `'a`, so we also have to diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr index 1aed0a545b4..1a5a3719fd8 100644 --- a/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env-wrong-bound.stderr @@ -1,10 +1,15 @@ -error[E0309]: the associated type `>::Output` may not live long enough - --> $DIR/projection-where-clause-env-wrong-bound.rs:17:5 +error[E0309]: the associated type `>::Output` may not live long enough + --> $DIR/projection-where-clause-env-wrong-bound.rs:15:5 | LL | bar::() | ^^^^^^^^^^^^^^^^ | - = help: consider adding an explicit lifetime bound `>::Output: 'a`... + = help: consider adding an explicit lifetime bound `>::Output: 'a`... +note: ...so that the type `>::Output` will meet its required lifetime bounds + --> $DIR/projection-where-clause-env-wrong-bound.rs:15:5 + | +LL | bar::() + | ^^^^^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/nll/ty-outlives/projection-where-clause-env.rs b/src/test/ui/nll/ty-outlives/projection-where-clause-env.rs index c6935badf54..73147666111 100644 --- a/src/test/ui/nll/ty-outlives/projection-where-clause-env.rs +++ b/src/test/ui/nll/ty-outlives/projection-where-clause-env.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // Test that when we have a `>::Output: 'a` // relationship in the environment we take advantage of it. In this // case, that means we **don't** have to prove that `T: 'a`. diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn-body-nll-feature.rs b/src/test/ui/nll/ty-outlives/ty-param-fn-body-nll-feature.rs deleted file mode 100644 index ec559437570..00000000000 --- a/src/test/ui/nll/ty-outlives/ty-param-fn-body-nll-feature.rs +++ /dev/null @@ -1,30 +0,0 @@ -// Test that we assume that universal types like `T` outlive the -// function body. Same as ty-param-fn-body, but uses `feature(nll)`, -// which affects error reporting. - -#![feature(nll)] - -#![allow(warnings)] - -use std::cell::Cell; - -// No errors here, because `'a` is local to the body. -fn region_within_body(t: T) { - let some_int = 22; - let cell = Cell::new(&some_int); - outlives(cell, t) -} - -// Error here, because T: 'a is not satisfied. -fn region_static<'a, T>(cell: Cell<&'a usize>, t: T) { - outlives(cell, t) - //~^ ERROR the parameter type `T` may not live long enough -} - -fn outlives<'a, T>(x: Cell<&'a usize>, y: T) -where - T: 'a, -{ -} - -fn main() {} diff --git a/src/test/ui/nll/ty-outlives/ty-param-fn-body-nll-feature.stderr b/src/test/ui/nll/ty-outlives/ty-param-fn-body-nll-feature.stderr deleted file mode 100644 index b3c02f7f429..00000000000 --- a/src/test/ui/nll/ty-outlives/ty-param-fn-body-nll-feature.stderr +++ /dev/null @@ -1,11 +0,0 @@ -error[E0309]: the parameter type `T` may not live long enough - --> $DIR/ty-param-fn-body-nll-feature.rs:20:5 - | -LL | outlives(cell, t) - | ^^^^^^^^^^^^^^^^^ - | - = help: consider adding an explicit lifetime bound `T: 'a`... - -error: aborting due to previous error - -For more information about this error, try `rustc --explain E0309`. diff --git a/src/test/ui/nll/type-alias-free-regions.nll.stderr b/src/test/ui/nll/type-alias-free-regions.nll.stderr new file mode 100644 index 00000000000..235bf4167d5 --- /dev/null +++ b/src/test/ui/nll/type-alias-free-regions.nll.stderr @@ -0,0 +1,22 @@ +error: lifetime may not live long enough + --> $DIR/type-alias-free-regions.rs:17:9 + | +LL | impl<'a> FromBox<'a> for C<'a> { + | -- lifetime `'a` defined here +LL | fn from_box(b: Box) -> Self { + | - has type `std::boxed::Box>` +LL | C { f: b } + | ^^^^^^^^^^ returning this value requires that `'1` must outlive `'a` + +error: lifetime may not live long enough + --> $DIR/type-alias-free-regions.rs:27:9 + | +LL | impl<'a> FromTuple<'a> for C<'a> { + | -- lifetime `'a` defined here +LL | fn from_tuple(b: (B,)) -> Self { + | - has type `(std::boxed::Box<&'1 isize>,)` +LL | C { f: Box::new(b.0) } + | ^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'a` + +error: aborting due to 2 previous errors + diff --git a/src/test/ui/nll/type-alias-free-regions.rs b/src/test/ui/nll/type-alias-free-regions.rs index ebe6b9d2073..fd5566f35d5 100644 --- a/src/test/ui/nll/type-alias-free-regions.rs +++ b/src/test/ui/nll/type-alias-free-regions.rs @@ -1,8 +1,6 @@ // Test that we don't assume that type aliases have the same type parameters // as the type they alias and then panic when we see this. -#![feature(nll)] - type A<'a> = &'a isize; type B<'a> = Box>; diff --git a/src/test/ui/nll/type-alias-free-regions.stderr b/src/test/ui/nll/type-alias-free-regions.stderr index 4facc2d0da0..00d58d34362 100644 --- a/src/test/ui/nll/type-alias-free-regions.stderr +++ b/src/test/ui/nll/type-alias-free-regions.stderr @@ -1,22 +1,52 @@ -error: lifetime may not live long enough - --> $DIR/type-alias-free-regions.rs:19:9 +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements + --> $DIR/type-alias-free-regions.rs:17:9 + | +LL | C { f: b } + | ^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 16:5... + --> $DIR/type-alias-free-regions.rs:16:5 + | +LL | / fn from_box(b: Box) -> Self { +LL | | C { f: b } +LL | | } + | |_____^ + = note: ...so that the expression is assignable: + expected std::boxed::Box> + found std::boxed::Box> +note: but, the lifetime must be valid for the lifetime 'a as defined on the impl at 15:6... + --> $DIR/type-alias-free-regions.rs:15:6 | LL | impl<'a> FromBox<'a> for C<'a> { - | -- lifetime `'a` defined here -LL | fn from_box(b: Box) -> Self { - | - has type `std::boxed::Box>` -LL | C { f: b } - | ^^^^^^^^^^ returning this value requires that `'1` must outlive `'a` + | ^^ + = note: ...so that the expression is assignable: + expected C<'a> + found C<'_> -error: lifetime may not live long enough - --> $DIR/type-alias-free-regions.rs:29:9 +error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements + --> $DIR/type-alias-free-regions.rs:27:16 + | +LL | C { f: Box::new(b.0) } + | ^^^^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the method body at 26:5... + --> $DIR/type-alias-free-regions.rs:26:5 + | +LL | / fn from_tuple(b: (B,)) -> Self { +LL | | C { f: Box::new(b.0) } +LL | | } + | |_____^ + = note: ...so that the expression is assignable: + expected std::boxed::Box<&isize> + found std::boxed::Box<&isize> +note: but, the lifetime must be valid for the lifetime 'a as defined on the impl at 25:6... + --> $DIR/type-alias-free-regions.rs:25:6 | LL | impl<'a> FromTuple<'a> for C<'a> { - | -- lifetime `'a` defined here -LL | fn from_tuple(b: (B,)) -> Self { - | - has type `(std::boxed::Box<&'1 isize>,)` -LL | C { f: Box::new(b.0) } - | ^^^^^^^^^^^^^^^^^^^^^^ returning this value requires that `'1` must outlive `'a` + | ^^ + = note: ...so that the expression is assignable: + expected C<'a> + found C<'_> error: aborting due to 2 previous errors diff --git a/src/test/ui/nll/unused-mut-issue-50343.rs b/src/test/ui/nll/unused-mut-issue-50343.rs index 06dbc473557..da0d9229c12 100644 --- a/src/test/ui/nll/unused-mut-issue-50343.rs +++ b/src/test/ui/nll/unused-mut-issue-50343.rs @@ -1,4 +1,3 @@ -#![feature(nll)] #![deny(unused_mut)] fn main() { diff --git a/src/test/ui/nll/unused-mut-issue-50343.stderr b/src/test/ui/nll/unused-mut-issue-50343.stderr index ef31dd7b29a..261d678db67 100644 --- a/src/test/ui/nll/unused-mut-issue-50343.stderr +++ b/src/test/ui/nll/unused-mut-issue-50343.stderr @@ -1,5 +1,5 @@ error: variable does not need to be mutable - --> $DIR/unused-mut-issue-50343.rs:5:33 + --> $DIR/unused-mut-issue-50343.rs:4:33 | LL | vec![(42, 22)].iter().map(|(mut x, _y)| ()).count(); | ----^ @@ -7,7 +7,7 @@ LL | vec![(42, 22)].iter().map(|(mut x, _y)| ()).count(); | help: remove this `mut` | note: lint level defined here - --> $DIR/unused-mut-issue-50343.rs:2:9 + --> $DIR/unused-mut-issue-50343.rs:1:9 | LL | #![deny(unused_mut)] | ^^^^^^^^^^ diff --git a/src/test/ui/nll/user-annotations/adt-brace-enums.rs b/src/test/ui/nll/user-annotations/adt-brace-enums.rs index 842ebae2618..0d9828342d8 100644 --- a/src/test/ui/nll/user-annotations/adt-brace-enums.rs +++ b/src/test/ui/nll/user-annotations/adt-brace-enums.rs @@ -1,8 +1,6 @@ // Unit test for the "user substitutions" that are annotated on each // node. -#![feature(nll)] - enum SomeEnum { SomeVariant { t: T } } diff --git a/src/test/ui/nll/user-annotations/adt-brace-enums.stderr b/src/test/ui/nll/user-annotations/adt-brace-enums.stderr index 38f068746a6..e38b77fdcea 100644 --- a/src/test/ui/nll/user-annotations/adt-brace-enums.stderr +++ b/src/test/ui/nll/user-annotations/adt-brace-enums.stderr @@ -1,5 +1,5 @@ error[E0597]: `c` does not live long enough - --> $DIR/adt-brace-enums.rs:27:48 + --> $DIR/adt-brace-enums.rs:25:48 | LL | SomeEnum::SomeVariant::<&'static u32> { t: &c }; | ^^ @@ -10,7 +10,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/adt-brace-enums.rs:32:43 + --> $DIR/adt-brace-enums.rs:30:43 | LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) { | -- lifetime `'a` defined here @@ -24,7 +24,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/adt-brace-enums.rs:42:47 + --> $DIR/adt-brace-enums.rs:40:47 | LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/adt-brace-structs.rs b/src/test/ui/nll/user-annotations/adt-brace-structs.rs index d7ebbe8eb5f..bdbfd87d584 100644 --- a/src/test/ui/nll/user-annotations/adt-brace-structs.rs +++ b/src/test/ui/nll/user-annotations/adt-brace-structs.rs @@ -1,8 +1,6 @@ // Unit test for the "user substitutions" that are annotated on each // node. -#![feature(nll)] - struct SomeStruct { t: T } fn no_annot() { diff --git a/src/test/ui/nll/user-annotations/adt-brace-structs.stderr b/src/test/ui/nll/user-annotations/adt-brace-structs.stderr index 25a9de480b2..3c3003477c2 100644 --- a/src/test/ui/nll/user-annotations/adt-brace-structs.stderr +++ b/src/test/ui/nll/user-annotations/adt-brace-structs.stderr @@ -1,5 +1,5 @@ error[E0597]: `c` does not live long enough - --> $DIR/adt-brace-structs.rs:25:37 + --> $DIR/adt-brace-structs.rs:23:37 | LL | SomeStruct::<&'static u32> { t: &c }; | ^^ @@ -10,7 +10,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/adt-brace-structs.rs:30:32 + --> $DIR/adt-brace-structs.rs:28:32 | LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) { | -- lifetime `'a` defined here @@ -24,7 +24,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/adt-brace-structs.rs:40:36 + --> $DIR/adt-brace-structs.rs:38:36 | LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/adt-nullary-enums.rs b/src/test/ui/nll/user-annotations/adt-nullary-enums.rs index 7a8f55a800b..53853668d19 100644 --- a/src/test/ui/nll/user-annotations/adt-nullary-enums.rs +++ b/src/test/ui/nll/user-annotations/adt-nullary-enums.rs @@ -1,7 +1,6 @@ // Unit test for the "user substitutions" that are annotated on each // node. -#![feature(nll)] #![allow(warnings)] use std::cell::Cell; diff --git a/src/test/ui/nll/user-annotations/adt-nullary-enums.stderr b/src/test/ui/nll/user-annotations/adt-nullary-enums.stderr index 1afbac7c4b2..bb703412228 100644 --- a/src/test/ui/nll/user-annotations/adt-nullary-enums.stderr +++ b/src/test/ui/nll/user-annotations/adt-nullary-enums.stderr @@ -1,5 +1,5 @@ error[E0597]: `c` does not live long enough - --> $DIR/adt-nullary-enums.rs:34:41 + --> $DIR/adt-nullary-enums.rs:33:41 | LL | SomeEnum::SomeVariant(Cell::new(&c)), | ----------^^- @@ -11,7 +11,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/adt-nullary-enums.rs:42:41 + --> $DIR/adt-nullary-enums.rs:41:41 | LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) { | -- lifetime `'a` defined here @@ -26,7 +26,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/adt-nullary-enums.rs:55:45 + --> $DIR/adt-nullary-enums.rs:54:45 | LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/adt-tuple-enums.rs b/src/test/ui/nll/user-annotations/adt-tuple-enums.rs index 085596ecc53..efe8dfda191 100644 --- a/src/test/ui/nll/user-annotations/adt-tuple-enums.rs +++ b/src/test/ui/nll/user-annotations/adt-tuple-enums.rs @@ -1,7 +1,6 @@ // Unit test for the "user substitutions" that are annotated on each // node. -#![feature(nll)] #![allow(warnings)] enum SomeEnum { diff --git a/src/test/ui/nll/user-annotations/adt-tuple-enums.stderr b/src/test/ui/nll/user-annotations/adt-tuple-enums.stderr index cd625653ace..810912bf886 100644 --- a/src/test/ui/nll/user-annotations/adt-tuple-enums.stderr +++ b/src/test/ui/nll/user-annotations/adt-tuple-enums.stderr @@ -1,5 +1,5 @@ error[E0597]: `c` does not live long enough - --> $DIR/adt-tuple-enums.rs:29:43 + --> $DIR/adt-tuple-enums.rs:28:43 | LL | SomeEnum::SomeVariant::<&'static u32>(&c); | ^^ @@ -10,7 +10,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/adt-tuple-enums.rs:34:38 + --> $DIR/adt-tuple-enums.rs:33:38 | LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) { | -- lifetime `'a` defined here @@ -24,7 +24,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/adt-tuple-enums.rs:44:42 + --> $DIR/adt-tuple-enums.rs:43:42 | LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/adt-tuple-struct.rs b/src/test/ui/nll/user-annotations/adt-tuple-struct.rs index ebbe3cd2c89..37284e1fda8 100644 --- a/src/test/ui/nll/user-annotations/adt-tuple-struct.rs +++ b/src/test/ui/nll/user-annotations/adt-tuple-struct.rs @@ -1,8 +1,6 @@ // Unit test for the "user substitutions" that are annotated on each // node. -#![feature(nll)] - struct SomeStruct(T); fn no_annot() { diff --git a/src/test/ui/nll/user-annotations/adt-tuple-struct.stderr b/src/test/ui/nll/user-annotations/adt-tuple-struct.stderr index 2bb58bb2590..4d2140eca1b 100644 --- a/src/test/ui/nll/user-annotations/adt-tuple-struct.stderr +++ b/src/test/ui/nll/user-annotations/adt-tuple-struct.stderr @@ -1,5 +1,5 @@ error[E0597]: `c` does not live long enough - --> $DIR/adt-tuple-struct.rs:25:32 + --> $DIR/adt-tuple-struct.rs:23:32 | LL | SomeStruct::<&'static u32>(&c); | ^^ @@ -10,7 +10,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/adt-tuple-struct.rs:30:27 + --> $DIR/adt-tuple-struct.rs:28:27 | LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) { | -- lifetime `'a` defined here @@ -24,7 +24,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/adt-tuple-struct.rs:40:31 + --> $DIR/adt-tuple-struct.rs:38:31 | LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/cast_static_lifetime.rs b/src/test/ui/nll/user-annotations/cast_static_lifetime.rs index 4756c771f6e..bb6129dacda 100644 --- a/src/test/ui/nll/user-annotations/cast_static_lifetime.rs +++ b/src/test/ui/nll/user-annotations/cast_static_lifetime.rs @@ -1,5 +1,4 @@ #![allow(warnings)] -#![feature(nll)] fn main() { let x = 22_u32; diff --git a/src/test/ui/nll/user-annotations/cast_static_lifetime.stderr b/src/test/ui/nll/user-annotations/cast_static_lifetime.stderr index 0228b56d761..4599d04e7e2 100644 --- a/src/test/ui/nll/user-annotations/cast_static_lifetime.stderr +++ b/src/test/ui/nll/user-annotations/cast_static_lifetime.stderr @@ -1,5 +1,5 @@ error[E0597]: `x` does not live long enough - --> $DIR/cast_static_lifetime.rs:6:19 + --> $DIR/cast_static_lifetime.rs:5:19 | LL | let y: &u32 = (&x) as &'static u32; | ^^^^---------------- diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr new file mode 100644 index 00000000000..c39301588ac --- /dev/null +++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.nll.stderr @@ -0,0 +1,10 @@ +error: lifetime may not live long enough + --> $DIR/constant-in-expr-inherent-1.rs:8:5 + | +LL | fn foo<'a>(_: &'a u32) -> &'static u32 { + | -- lifetime `'a` defined here +LL | >::C + | ^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + +error: aborting due to previous error + diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs index 9f0c60967ef..e3a8a5f58df 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct Foo<'a> { x: &'a u32 } impl<'a> Foo<'a> { diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr index 9a28fbd1133..77e1339dc16 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-1.stderr @@ -1,10 +1,23 @@ -error: lifetime may not live long enough - --> $DIR/constant-in-expr-inherent-1.rs:10:5 +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements + --> $DIR/constant-in-expr-inherent-1.rs:8:5 + | +LL | >::C + | ^^^^^^^^^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 7:8... + --> $DIR/constant-in-expr-inherent-1.rs:7:8 | LL | fn foo<'a>(_: &'a u32) -> &'static u32 { - | -- lifetime `'a` defined here + | ^^ + = note: ...so that the types are compatible: + expected Foo<'_> + found Foo<'a> + = note: but, the lifetime must be valid for the static lifetime... +note: ...so that reference does not outlive borrowed content + --> $DIR/constant-in-expr-inherent-1.rs:8:5 + | LL | >::C - | ^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | ^^^^^^^^^^^^ error: aborting due to previous error diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.rs b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.rs index 123be6b3e40..90696d4b17d 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.rs @@ -1,8 +1,6 @@ // Test that we still check constants are well-formed, even when we there's no // type annotation to check. -#![feature(nll)] - const FUN: fn(&'static ()) = |_| {}; struct A; impl A { diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.stderr index 07e2e1e85cb..12065a85aa4 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-inherent-2.stderr @@ -1,5 +1,5 @@ error[E0597]: `x` does not live long enough - --> $DIR/constant-in-expr-inherent-2.rs:25:9 + --> $DIR/constant-in-expr-inherent-2.rs:23:9 | LL | FUN(&x); | ----^^- @@ -11,7 +11,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/constant-in-expr-inherent-2.rs:26:23 + --> $DIR/constant-in-expr-inherent-2.rs:24:23 | LL | A::ASSOCIATED_FUN(&x); | ------------------^^- @@ -23,7 +23,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/constant-in-expr-inherent-2.rs:27:28 + --> $DIR/constant-in-expr-inherent-2.rs:25:28 | LL | B::ALSO_ASSOCIATED_FUN(&x); | -----------------------^^- @@ -35,7 +35,7 @@ LL | } | - `x` dropped here while still borrowed error[E0597]: `x` does not live long enough - --> $DIR/constant-in-expr-inherent-2.rs:28:31 + --> $DIR/constant-in-expr-inherent-2.rs:26:31 | LL | <_>::TRAIT_ASSOCIATED_FUN(&x); | --------------------------^^- diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr new file mode 100644 index 00000000000..541a2cfaf29 --- /dev/null +++ b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.nll.stderr @@ -0,0 +1,10 @@ +error: lifetime may not live long enough + --> $DIR/constant-in-expr-normalize.rs:18:5 + | +LL | fn foo<'a>(_: &'a u32) -> &'static u32 { + | -- lifetime `'a` defined here +LL | <() as Foo<'a>>::C + | ^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + +error: aborting due to previous error + diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs index 4292fc710e9..b7095430d8b 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - trait Mirror { type Me; } diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.stderr index 5e66a30d7c3..f49d68458be 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-normalize.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-normalize.stderr @@ -1,10 +1,15 @@ -error: lifetime may not live long enough - --> $DIR/constant-in-expr-normalize.rs:20:5 +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/constant-in-expr-normalize.rs:18:5 + | +LL | <() as Foo<'a>>::C + | ^^^^^^^^^^^^^^^^^^ + | + = note: ...the reference is valid for the static lifetime... +note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 17:8 + --> $DIR/constant-in-expr-normalize.rs:17:8 | LL | fn foo<'a>(_: &'a u32) -> &'static u32 { - | -- lifetime `'a` defined here -LL | <() as Foo<'a>>::C - | ^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | ^^ error: aborting due to previous error diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr new file mode 100644 index 00000000000..ea0fcb6d634 --- /dev/null +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.nll.stderr @@ -0,0 +1,10 @@ +error: lifetime may not live long enough + --> $DIR/constant-in-expr-trait-item-1.rs:10:5 + | +LL | fn foo<'a>(_: &'a u32) -> &'static u32 { + | -- lifetime `'a` defined here +LL | <() as Foo<'a>>::C + | ^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + +error: aborting due to previous error + diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs index daa0d7bc241..e0400b2cc02 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - trait Foo<'a> { const C: &'a u32; } diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.stderr index c96838f259a..451bcf41e42 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-1.stderr @@ -1,10 +1,15 @@ -error: lifetime may not live long enough - --> $DIR/constant-in-expr-trait-item-1.rs:12:5 +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/constant-in-expr-trait-item-1.rs:10:5 + | +LL | <() as Foo<'a>>::C + | ^^^^^^^^^^^^^^^^^^ + | + = note: ...the reference is valid for the static lifetime... +note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 9:8 + --> $DIR/constant-in-expr-trait-item-1.rs:9:8 | LL | fn foo<'a>(_: &'a u32) -> &'static u32 { - | -- lifetime `'a` defined here -LL | <() as Foo<'a>>::C - | ^^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | ^^ error: aborting due to previous error diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr new file mode 100644 index 00000000000..ff549f1d88b --- /dev/null +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.nll.stderr @@ -0,0 +1,10 @@ +error: lifetime may not live long enough + --> $DIR/constant-in-expr-trait-item-2.rs:10:5 + | +LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { + | -- lifetime `'a` defined here +LL | >::C + | ^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + +error: aborting due to previous error + diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs index cd66e7a49cb..73c4e577b05 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - trait Foo<'a> { const C: &'a u32; } diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.stderr index fcc3c40e43f..d129e55e1e6 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-2.stderr @@ -1,10 +1,15 @@ -error: lifetime may not live long enough - --> $DIR/constant-in-expr-trait-item-2.rs:12:5 +error[E0312]: lifetime of reference outlives lifetime of borrowed content... + --> $DIR/constant-in-expr-trait-item-2.rs:10:5 + | +LL | >::C + | ^^^^^^^^^^^^^^^^^ + | + = note: ...the reference is valid for the static lifetime... +note: ...but the borrowed content is only valid for the lifetime 'a as defined on the function body at 9:8 + --> $DIR/constant-in-expr-trait-item-2.rs:9:8 | LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { - | -- lifetime `'a` defined here -LL | >::C - | ^^^^^^^^^^^^^^^^^ returning this value requires that `'a` must outlive `'static` + | ^^ error: aborting due to previous error diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr new file mode 100644 index 00000000000..7f160d8e398 --- /dev/null +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.nll.stderr @@ -0,0 +1,10 @@ +error: lifetime may not live long enough + --> $DIR/constant-in-expr-trait-item-3.rs:10:5 + | +LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { + | -- lifetime `'a` defined here +LL | T::C + | ^^^^ returning this value requires that `'a` must outlive `'static` + +error: aborting due to previous error + diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs index f83ae2438e6..567e31ef936 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - trait Foo<'a> { const C: &'a u32; } diff --git a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr index c91370c810c..77655fe091b 100644 --- a/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr +++ b/src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr @@ -1,10 +1,23 @@ -error: lifetime may not live long enough - --> $DIR/constant-in-expr-trait-item-3.rs:12:5 +error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements + --> $DIR/constant-in-expr-trait-item-3.rs:10:5 + | +LL | T::C + | ^^^^ + | +note: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 9:8... + --> $DIR/constant-in-expr-trait-item-3.rs:9:8 | LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 { - | -- lifetime `'a` defined here + | ^^ + = note: ...so that the types are compatible: + expected Foo<'_> + found Foo<'a> + = note: but, the lifetime must be valid for the static lifetime... +note: ...so that reference does not outlive borrowed content + --> $DIR/constant-in-expr-trait-item-3.rs:10:5 + | LL | T::C - | ^^^^ returning this value requires that `'a` must outlive `'static` + | ^^^^ error: aborting due to previous error diff --git a/src/test/ui/nll/user-annotations/fns.rs b/src/test/ui/nll/user-annotations/fns.rs index 1e5e9340bef..38db6d1c4c5 100644 --- a/src/test/ui/nll/user-annotations/fns.rs +++ b/src/test/ui/nll/user-annotations/fns.rs @@ -1,8 +1,6 @@ // Unit test for the "user substitutions" that are annotated on each // node. -#![feature(nll)] - fn some_fn(arg: T) { } fn no_annot() { diff --git a/src/test/ui/nll/user-annotations/fns.stderr b/src/test/ui/nll/user-annotations/fns.stderr index dadce24159e..e0640da39e2 100644 --- a/src/test/ui/nll/user-annotations/fns.stderr +++ b/src/test/ui/nll/user-annotations/fns.stderr @@ -1,5 +1,5 @@ error[E0597]: `c` does not live long enough - --> $DIR/fns.rs:25:29 + --> $DIR/fns.rs:23:29 | LL | some_fn::<&'static u32>(&c); | ------------------------^^- @@ -10,7 +10,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/fns.rs:30:24 + --> $DIR/fns.rs:28:24 | LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) { | -- lifetime `'a` defined here @@ -24,7 +24,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/fns.rs:40:28 + --> $DIR/fns.rs:38:28 | LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/issue-54570-bootstrapping.rs b/src/test/ui/nll/user-annotations/issue-54570-bootstrapping.rs index 0a8a6793dc7..6b9d30f5ab4 100644 --- a/src/test/ui/nll/user-annotations/issue-54570-bootstrapping.rs +++ b/src/test/ui/nll/user-annotations/issue-54570-bootstrapping.rs @@ -1,5 +1,4 @@ // compile-pass -#![feature(nll)] // This test is reduced from a scenario pnkfelix encountered while // bootstrapping the compiler. diff --git a/src/test/ui/nll/user-annotations/issue-55219.rs b/src/test/ui/nll/user-annotations/issue-55219.rs index 7daa5a59b99..4d18e96cc15 100644 --- a/src/test/ui/nll/user-annotations/issue-55219.rs +++ b/src/test/ui/nll/user-annotations/issue-55219.rs @@ -5,8 +5,6 @@ // // run-pass -#![feature(nll)] - pub struct Foo(T); impl Foo { diff --git a/src/test/ui/nll/user-annotations/issue-55241.rs b/src/test/ui/nll/user-annotations/issue-55241.rs index d7686b9dc94..29969c7b4c6 100644 --- a/src/test/ui/nll/user-annotations/issue-55241.rs +++ b/src/test/ui/nll/user-annotations/issue-55241.rs @@ -7,8 +7,6 @@ // // run-pass -#![feature(nll)] - pub trait Hasher { type Out: Eq; } diff --git a/src/test/ui/nll/user-annotations/method-call.rs b/src/test/ui/nll/user-annotations/method-call.rs index 59d1513c4c3..beafc597ac1 100644 --- a/src/test/ui/nll/user-annotations/method-call.rs +++ b/src/test/ui/nll/user-annotations/method-call.rs @@ -1,8 +1,6 @@ // Unit test for the "user substitutions" that are annotated on each // node. -#![feature(nll)] - trait Bazoom { fn method(&self, arg: T, arg2: U) { } } diff --git a/src/test/ui/nll/user-annotations/method-call.stderr b/src/test/ui/nll/user-annotations/method-call.stderr index 7e5314614f3..10447e45a6d 100644 --- a/src/test/ui/nll/user-annotations/method-call.stderr +++ b/src/test/ui/nll/user-annotations/method-call.stderr @@ -1,5 +1,5 @@ error[E0597]: `c` does not live long enough - --> $DIR/method-call.rs:38:34 + --> $DIR/method-call.rs:36:34 | LL | a.method::<&'static u32>(b, &c); | -----------------------------^^- @@ -10,7 +10,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/method-call.rs:45:29 + --> $DIR/method-call.rs:43:29 | LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) { | -- lifetime `'a` defined here @@ -24,7 +24,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/method-call.rs:59:33 + --> $DIR/method-call.rs:57:33 | LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/method-ufcs-1.rs b/src/test/ui/nll/user-annotations/method-ufcs-1.rs index 7968a9f6c4f..950771f35e4 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-1.rs +++ b/src/test/ui/nll/user-annotations/method-ufcs-1.rs @@ -1,8 +1,6 @@ // Unit test for the "user substitutions" that are annotated on each // node. -#![feature(nll)] - trait Bazoom: Sized { fn method(self, arg: T, arg2: U) { } } diff --git a/src/test/ui/nll/user-annotations/method-ufcs-1.stderr b/src/test/ui/nll/user-annotations/method-ufcs-1.stderr index 12b02ba33f7..962ddfd2bd1 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-1.stderr +++ b/src/test/ui/nll/user-annotations/method-ufcs-1.stderr @@ -1,5 +1,5 @@ error[E0597]: `a` does not live long enough - --> $DIR/method-ufcs-1.rs:32:7 + --> $DIR/method-ufcs-1.rs:30:7 | LL | x(&a, b, c); | --^^------- @@ -10,7 +10,7 @@ LL | } | - `a` dropped here while still borrowed error[E0597]: `a` does not live long enough - --> $DIR/method-ufcs-1.rs:39:36 + --> $DIR/method-ufcs-1.rs:37:36 | LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) { | -- lifetime `'a` defined here @@ -24,7 +24,7 @@ LL | } | - `a` dropped here while still borrowed error[E0597]: `a` does not live long enough - --> $DIR/method-ufcs-1.rs:53:41 + --> $DIR/method-ufcs-1.rs:51:41 | LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/method-ufcs-2.rs b/src/test/ui/nll/user-annotations/method-ufcs-2.rs index a1d0e7b4c92..7dc0f0c12a4 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-2.rs +++ b/src/test/ui/nll/user-annotations/method-ufcs-2.rs @@ -1,8 +1,6 @@ // Unit test for the "user substitutions" that are annotated on each // node. -#![feature(nll)] - trait Bazoom: Sized { fn method(self, arg: T, arg2: U) { } } diff --git a/src/test/ui/nll/user-annotations/method-ufcs-2.stderr b/src/test/ui/nll/user-annotations/method-ufcs-2.stderr index a55ed1aa272..63d59905e1c 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-2.stderr +++ b/src/test/ui/nll/user-annotations/method-ufcs-2.stderr @@ -1,5 +1,5 @@ error[E0597]: `a` does not live long enough - --> $DIR/method-ufcs-2.rs:32:7 + --> $DIR/method-ufcs-2.rs:30:7 | LL | x(&a, b, c); | --^^------- @@ -10,7 +10,7 @@ LL | } | - `a` dropped here while still borrowed error[E0597]: `b` does not live long enough - --> $DIR/method-ufcs-2.rs:39:39 + --> $DIR/method-ufcs-2.rs:37:39 | LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) { | -- lifetime `'a` defined here @@ -24,7 +24,7 @@ LL | } | - `b` dropped here while still borrowed error[E0597]: `b` does not live long enough - --> $DIR/method-ufcs-2.rs:53:44 + --> $DIR/method-ufcs-2.rs:51:44 | LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/method-ufcs-3.rs b/src/test/ui/nll/user-annotations/method-ufcs-3.rs index ea480c03c35..59d2009d14b 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-3.rs +++ b/src/test/ui/nll/user-annotations/method-ufcs-3.rs @@ -1,8 +1,6 @@ // Unit test for the "user substitutions" that are annotated on each // node. -#![feature(nll)] - trait Bazoom { fn method(&self, arg: T, arg2: U) { } } diff --git a/src/test/ui/nll/user-annotations/method-ufcs-3.stderr b/src/test/ui/nll/user-annotations/method-ufcs-3.stderr index 140bda2df41..e7851833e93 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-3.stderr +++ b/src/test/ui/nll/user-annotations/method-ufcs-3.stderr @@ -1,5 +1,5 @@ error[E0597]: `c` does not live long enough - --> $DIR/method-ufcs-3.rs:38:53 + --> $DIR/method-ufcs-3.rs:36:53 | LL | <_ as Bazoom<_>>::method::<&'static u32>(&a, b, &c); | ------------------------------------------------^^- @@ -10,7 +10,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/method-ufcs-3.rs:45:48 + --> $DIR/method-ufcs-3.rs:43:48 | LL | fn annot_reference_named_lifetime<'a>(_d: &'a u32) { | -- lifetime `'a` defined here @@ -24,7 +24,7 @@ LL | } | - `c` dropped here while still borrowed error[E0597]: `c` does not live long enough - --> $DIR/method-ufcs-3.rs:59:52 + --> $DIR/method-ufcs-3.rs:57:52 | LL | fn annot_reference_named_lifetime_in_closure<'a>(_: &'a u32) { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/method-ufcs-inherent-2.rs b/src/test/ui/nll/user-annotations/method-ufcs-inherent-2.rs index a77d6af5323..cfbc0bcf6b0 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-inherent-2.rs +++ b/src/test/ui/nll/user-annotations/method-ufcs-inherent-2.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // Check that substitutions given on the self type (here, `A`) can be // used in combination with annotations given for method arguments. diff --git a/src/test/ui/nll/user-annotations/method-ufcs-inherent-2.stderr b/src/test/ui/nll/user-annotations/method-ufcs-inherent-2.stderr index 4dc534b2e77..06f20d9b235 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-inherent-2.stderr +++ b/src/test/ui/nll/user-annotations/method-ufcs-inherent-2.stderr @@ -1,5 +1,5 @@ error[E0597]: `v` does not live long enough - --> $DIR/method-ufcs-inherent-2.rs:16:37 + --> $DIR/method-ufcs-inherent-2.rs:14:37 | LL | fn foo<'a>() { | -- lifetime `'a` defined here @@ -14,7 +14,7 @@ LL | } | - `v` dropped here while still borrowed error[E0597]: `v` does not live long enough - --> $DIR/method-ufcs-inherent-2.rs:16:41 + --> $DIR/method-ufcs-inherent-2.rs:14:41 | LL | fn foo<'a>() { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/method-ufcs-inherent-4.rs b/src/test/ui/nll/user-annotations/method-ufcs-inherent-4.rs index 3f88c3df48e..85e7597390d 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-inherent-4.rs +++ b/src/test/ui/nll/user-annotations/method-ufcs-inherent-4.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - // Check that inherent methods invoked with `::new` style // carry their annotations through to NLL in connection with // method type parameters. diff --git a/src/test/ui/nll/user-annotations/method-ufcs-inherent-4.stderr b/src/test/ui/nll/user-annotations/method-ufcs-inherent-4.stderr index a41cf50465e..0f83e99cdfb 100644 --- a/src/test/ui/nll/user-annotations/method-ufcs-inherent-4.stderr +++ b/src/test/ui/nll/user-annotations/method-ufcs-inherent-4.stderr @@ -1,5 +1,5 @@ error[E0597]: `v` does not live long enough - --> $DIR/method-ufcs-inherent-4.rs:17:37 + --> $DIR/method-ufcs-inherent-4.rs:15:37 | LL | fn foo<'a>() { | -- lifetime `'a` defined here @@ -14,7 +14,7 @@ LL | } | - `v` dropped here while still borrowed error[E0597]: `v` does not live long enough - --> $DIR/method-ufcs-inherent-4.rs:17:41 + --> $DIR/method-ufcs-inherent-4.rs:15:41 | LL | fn foo<'a>() { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/normalization.rs b/src/test/ui/nll/user-annotations/normalization.rs index e0af2e67e18..870e3d8110c 100644 --- a/src/test/ui/nll/user-annotations/normalization.rs +++ b/src/test/ui/nll/user-annotations/normalization.rs @@ -1,8 +1,6 @@ // Test that we enforce a `&'static` requirement that is only visible // after normalization. -#![feature(nll)] - trait Foo { type Out; } impl Foo for () { type Out = &'static u32; } diff --git a/src/test/ui/nll/user-annotations/normalization.stderr b/src/test/ui/nll/user-annotations/normalization.stderr index fe93c3edba8..4c7893789a5 100644 --- a/src/test/ui/nll/user-annotations/normalization.stderr +++ b/src/test/ui/nll/user-annotations/normalization.stderr @@ -1,5 +1,5 @@ error[E0597]: `a` does not live long enough - --> $DIR/normalization.rs:11:31 + --> $DIR/normalization.rs:9:31 | LL | let b: <() as Foo>::Out = &a; | ---------------- ^^ borrowed value does not live long enough diff --git a/src/test/ui/nll/user-annotations/normalize-self-ty.rs b/src/test/ui/nll/user-annotations/normalize-self-ty.rs index d97cc88dd9a..a06229a0203 100644 --- a/src/test/ui/nll/user-annotations/normalize-self-ty.rs +++ b/src/test/ui/nll/user-annotations/normalize-self-ty.rs @@ -4,8 +4,6 @@ // // run-pass -#![feature(nll)] - trait Mirror { type Me; } diff --git a/src/test/ui/nll/user-annotations/pattern_substs_on_brace_enum_variant.rs b/src/test/ui/nll/user-annotations/pattern_substs_on_brace_enum_variant.rs index 526134b6e4b..59cd69c0ca5 100644 --- a/src/test/ui/nll/user-annotations/pattern_substs_on_brace_enum_variant.rs +++ b/src/test/ui/nll/user-annotations/pattern_substs_on_brace_enum_variant.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - enum Foo<'a> { Bar { field: &'a u32 } } diff --git a/src/test/ui/nll/user-annotations/pattern_substs_on_brace_enum_variant.stderr b/src/test/ui/nll/user-annotations/pattern_substs_on_brace_enum_variant.stderr index b483f219c90..a97e7a9fd46 100644 --- a/src/test/ui/nll/user-annotations/pattern_substs_on_brace_enum_variant.stderr +++ b/src/test/ui/nll/user-annotations/pattern_substs_on_brace_enum_variant.stderr @@ -1,5 +1,5 @@ error[E0597]: `y` does not live long enough - --> $DIR/pattern_substs_on_brace_enum_variant.rs:9:33 + --> $DIR/pattern_substs_on_brace_enum_variant.rs:7:33 | LL | let foo = Foo::Bar { field: &y }; | ^^ borrowed value does not live long enough @@ -10,7 +10,7 @@ LL | } | - `y` dropped here while still borrowed error[E0597]: `y` does not live long enough - --> $DIR/pattern_substs_on_brace_enum_variant.rs:16:33 + --> $DIR/pattern_substs_on_brace_enum_variant.rs:14:33 | LL | let foo = Foo::Bar { field: &y }; | ^^ borrowed value does not live long enough diff --git a/src/test/ui/nll/user-annotations/pattern_substs_on_brace_struct.rs b/src/test/ui/nll/user-annotations/pattern_substs_on_brace_struct.rs index 1c92858eb3a..1586c4ea30c 100644 --- a/src/test/ui/nll/user-annotations/pattern_substs_on_brace_struct.rs +++ b/src/test/ui/nll/user-annotations/pattern_substs_on_brace_struct.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct Foo<'a> { field: &'a u32 } fn in_let() { diff --git a/src/test/ui/nll/user-annotations/pattern_substs_on_brace_struct.stderr b/src/test/ui/nll/user-annotations/pattern_substs_on_brace_struct.stderr index 9c888b0bffe..408d7c2a5e2 100644 --- a/src/test/ui/nll/user-annotations/pattern_substs_on_brace_struct.stderr +++ b/src/test/ui/nll/user-annotations/pattern_substs_on_brace_struct.stderr @@ -1,5 +1,5 @@ error[E0597]: `y` does not live long enough - --> $DIR/pattern_substs_on_brace_struct.rs:7:28 + --> $DIR/pattern_substs_on_brace_struct.rs:5:28 | LL | let foo = Foo { field: &y }; | ^^ borrowed value does not live long enough @@ -10,7 +10,7 @@ LL | } | - `y` dropped here while still borrowed error[E0597]: `y` does not live long enough - --> $DIR/pattern_substs_on_brace_struct.rs:14:28 + --> $DIR/pattern_substs_on_brace_struct.rs:12:28 | LL | let foo = Foo { field: &y }; | ^^ borrowed value does not live long enough diff --git a/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_enum_variant.rs b/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_enum_variant.rs index d6c364f8e3f..6fa59fdd8d8 100644 --- a/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_enum_variant.rs +++ b/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_enum_variant.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - enum Foo<'a> { Bar(&'a u32) } diff --git a/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_enum_variant.stderr b/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_enum_variant.stderr index 698cff51126..920c906f63a 100644 --- a/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_enum_variant.stderr +++ b/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_enum_variant.stderr @@ -1,5 +1,5 @@ error[E0597]: `y` does not live long enough - --> $DIR/pattern_substs_on_tuple_enum_variant.rs:9:24 + --> $DIR/pattern_substs_on_tuple_enum_variant.rs:7:24 | LL | let foo = Foo::Bar(&y); | ^^ borrowed value does not live long enough @@ -10,7 +10,7 @@ LL | } | - `y` dropped here while still borrowed error[E0597]: `y` does not live long enough - --> $DIR/pattern_substs_on_tuple_enum_variant.rs:16:24 + --> $DIR/pattern_substs_on_tuple_enum_variant.rs:14:24 | LL | let foo = Foo::Bar(&y); | ^^ borrowed value does not live long enough diff --git a/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_struct.rs b/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_struct.rs index 626ca908797..7486aab0e08 100644 --- a/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_struct.rs +++ b/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_struct.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct Foo<'a>(&'a u32); fn in_let() { diff --git a/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_struct.stderr b/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_struct.stderr index b5f2cb8e321..3f01638d847 100644 --- a/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_struct.stderr +++ b/src/test/ui/nll/user-annotations/pattern_substs_on_tuple_struct.stderr @@ -1,5 +1,5 @@ error[E0597]: `y` does not live long enough - --> $DIR/pattern_substs_on_tuple_struct.rs:7:19 + --> $DIR/pattern_substs_on_tuple_struct.rs:5:19 | LL | let foo = Foo(&y); | ^^ borrowed value does not live long enough @@ -10,7 +10,7 @@ LL | } | - `y` dropped here while still borrowed error[E0597]: `y` does not live long enough - --> $DIR/pattern_substs_on_tuple_struct.rs:14:19 + --> $DIR/pattern_substs_on_tuple_struct.rs:12:19 | LL | let foo = Foo(&y); | ^^ borrowed value does not live long enough diff --git a/src/test/ui/nll/user-annotations/promoted-annotation.rs b/src/test/ui/nll/user-annotations/promoted-annotation.rs index fa2d2fb8118..b92f8bfd23b 100644 --- a/src/test/ui/nll/user-annotations/promoted-annotation.rs +++ b/src/test/ui/nll/user-annotations/promoted-annotation.rs @@ -1,7 +1,5 @@ // Test that type annotations are checked in promoted constants correctly. -#![feature(nll)] - fn foo<'a>() { let x = 0; let f = &drop::<&'a i32>; diff --git a/src/test/ui/nll/user-annotations/promoted-annotation.stderr b/src/test/ui/nll/user-annotations/promoted-annotation.stderr index d8b01f22145..cb99a6a369d 100644 --- a/src/test/ui/nll/user-annotations/promoted-annotation.stderr +++ b/src/test/ui/nll/user-annotations/promoted-annotation.stderr @@ -1,5 +1,5 @@ error[E0597]: `x` does not live long enough - --> $DIR/promoted-annotation.rs:8:7 + --> $DIR/promoted-annotation.rs:6:7 | LL | fn foo<'a>() { | -- lifetime `'a` defined here diff --git a/src/test/ui/nll/user-annotations/type_ascription_static_lifetime.rs b/src/test/ui/nll/user-annotations/type_ascription_static_lifetime.rs index 362fe51c3ea..101b5cfabb3 100644 --- a/src/test/ui/nll/user-annotations/type_ascription_static_lifetime.rs +++ b/src/test/ui/nll/user-annotations/type_ascription_static_lifetime.rs @@ -1,5 +1,4 @@ #![allow(warnings)] -#![feature(nll)] #![feature(type_ascription)] fn main() { diff --git a/src/test/ui/nll/user-annotations/type_ascription_static_lifetime.stderr b/src/test/ui/nll/user-annotations/type_ascription_static_lifetime.stderr index 93dbf7cb1b3..133bbef5231 100644 --- a/src/test/ui/nll/user-annotations/type_ascription_static_lifetime.stderr +++ b/src/test/ui/nll/user-annotations/type_ascription_static_lifetime.stderr @@ -1,5 +1,5 @@ error[E0597]: `x` does not live long enough - --> $DIR/type_ascription_static_lifetime.rs:7:19 + --> $DIR/type_ascription_static_lifetime.rs:6:19 | LL | let y: &u32 = &x: &'static u32; | ^^-------------- diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs index 2f3c094ff39..7b499af632e 100644 --- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs +++ b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/bind-by-move-no-guards.rs @@ -4,7 +4,6 @@ // compile-pass -#![feature(nll)] #![feature(bind_by_move_pattern_guards)] use std::sync::mpsc::channel; diff --git a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs index 9a9d11ce1b1..aca6aa5f0f8 100644 --- a/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs +++ b/src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-basic-examples.rs @@ -1,4 +1,3 @@ -#![feature(nll)] #![feature(bind_by_move_pattern_guards)] // compile-pass diff --git a/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.rs b/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.rs index 4faede35305..1c1230346a5 100644 --- a/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.rs +++ b/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - #[derive(Clone)] enum Either { One(X), diff --git a/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr b/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr index b1aaab6a754..f8e043fbfdf 100644 --- a/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr +++ b/src/test/ui/suggestions/dont-suggest-ref/duplicate-suggestions.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:41:27 + --> $DIR/duplicate-suggestions.rs:39:27 | LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone()); | --------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -9,13 +9,13 @@ LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone()); | help: consider removing the `&`: `(X(_t), X(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:41:13 + --> $DIR/duplicate-suggestions.rs:39:13 | LL | let &(X(_t), X(_u)) = &(x.clone(), x.clone()); | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:45:50 + --> $DIR/duplicate-suggestions.rs:43:50 | LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } | ----------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -25,13 +25,13 @@ LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:45:26 + --> $DIR/duplicate-suggestions.rs:43:26 | LL | if let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:49:53 + --> $DIR/duplicate-suggestions.rs:47:53 | LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } | ----------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -41,13 +41,13 @@ LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:49:29 + --> $DIR/duplicate-suggestions.rs:47:29 | LL | while let &(Either::One(_t), Either::Two(_u)) = &(e.clone(), e.clone()) { } | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:53:11 + --> $DIR/duplicate-suggestions.rs:51:11 | LL | match &(e.clone(), e.clone()) { | ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -61,7 +61,7 @@ LL | &(Either::Two(_t), Either::One(_u)) => (), | -- ...and here -- ...and here | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:55:23 + --> $DIR/duplicate-suggestions.rs:53:23 | LL | &(Either::One(_t), Either::Two(_u)) => (), | ^^ ^^ @@ -78,7 +78,7 @@ LL | (Either::Two(_t), Either::One(_u)) => (), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:63:11 + --> $DIR/duplicate-suggestions.rs:61:11 | LL | match &(e.clone(), e.clone()) { | ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -91,13 +91,13 @@ LL | &(Either::One(_t), Either::Two(_u)) | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:65:23 + --> $DIR/duplicate-suggestions.rs:63:23 | LL | &(Either::One(_t), Either::Two(_u)) | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:72:11 + --> $DIR/duplicate-suggestions.rs:70:11 | LL | match &(e.clone(), e.clone()) { | ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -110,13 +110,13 @@ LL | &(Either::One(_t), Either::Two(_u)) => (), | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:74:23 + --> $DIR/duplicate-suggestions.rs:72:23 | LL | &(Either::One(_t), Either::Two(_u)) => (), | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:80:11 + --> $DIR/duplicate-suggestions.rs:78:11 | LL | match &(e.clone(), e.clone()) { | ^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -129,13 +129,13 @@ LL | &(Either::One(_t), Either::Two(_u)) => (), | help: consider removing the `&`: `(Either::One(_t), Either::Two(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:82:23 + --> $DIR/duplicate-suggestions.rs:80:23 | LL | &(Either::One(_t), Either::Two(_u)) => (), | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:93:31 + --> $DIR/duplicate-suggestions.rs:91:31 | LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); | ------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -145,13 +145,13 @@ LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); | help: consider removing the `&mut`: `(X(_t), X(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:93:17 + --> $DIR/duplicate-suggestions.rs:91:17 | LL | let &mut (X(_t), X(_u)) = &mut (xm.clone(), xm.clone()); | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:97:54 + --> $DIR/duplicate-suggestions.rs:95:54 | LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } | --------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -161,13 +161,13 @@ LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.c | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:97:30 + --> $DIR/duplicate-suggestions.rs:95:30 | LL | if let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:101:57 + --> $DIR/duplicate-suggestions.rs:99:57 | LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } | --------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -177,13 +177,13 @@ LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), e | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:101:33 + --> $DIR/duplicate-suggestions.rs:99:33 | LL | while let &mut (Either::One(_t), Either::Two(_u)) = &mut (em.clone(), em.clone()) { } | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:105:11 + --> $DIR/duplicate-suggestions.rs:103:11 | LL | match &mut (em.clone(), em.clone()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -197,7 +197,7 @@ LL | &mut (Either::Two(_t), Either::One(_u)) => (), | -- ...and here -- ...and here | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:107:27 + --> $DIR/duplicate-suggestions.rs:105:27 | LL | &mut (Either::One(_t), Either::Two(_u)) => (), | ^^ ^^ @@ -214,7 +214,7 @@ LL | (Either::Two(_t), Either::One(_u)) => (), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:115:11 + --> $DIR/duplicate-suggestions.rs:113:11 | LL | match &mut (em.clone(), em.clone()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -227,13 +227,13 @@ LL | &mut (Either::One(_t), Either::Two(_u)) | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:117:27 + --> $DIR/duplicate-suggestions.rs:115:27 | LL | &mut (Either::One(_t), Either::Two(_u)) | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:124:11 + --> $DIR/duplicate-suggestions.rs:122:11 | LL | match &mut (em.clone(), em.clone()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -246,13 +246,13 @@ LL | &mut (Either::One(_t), Either::Two(_u)) => (), | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:126:27 + --> $DIR/duplicate-suggestions.rs:124:27 | LL | &mut (Either::One(_t), Either::Two(_u)) => (), | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:132:11 + --> $DIR/duplicate-suggestions.rs:130:11 | LL | match &mut (em.clone(), em.clone()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -265,13 +265,13 @@ LL | &mut (Either::One(_t), Either::Two(_u)) => (), | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:134:27 + --> $DIR/duplicate-suggestions.rs:132:27 | LL | &mut (Either::One(_t), Either::Two(_u)) => (), | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:140:11 + --> $DIR/duplicate-suggestions.rs:138:11 | LL | match &mut (em.clone(), em.clone()) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -284,13 +284,13 @@ LL | &mut (Either::One(_t), Either::Two(_u)) => (), | help: consider removing the `&mut`: `(Either::One(_t), Either::Two(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:142:27 + --> $DIR/duplicate-suggestions.rs:140:27 | LL | &mut (Either::One(_t), Either::Two(_u)) => (), | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:88:11 + --> $DIR/duplicate-suggestions.rs:86:11 | LL | fn f5(&(X(_t), X(_u)): &(X, X)) { } | ^^^^--^^^^^--^^ @@ -301,13 +301,13 @@ LL | fn f5(&(X(_t), X(_u)): &(X, X)) { } | help: consider removing the `&`: `(X(_t), X(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:88:15 + --> $DIR/duplicate-suggestions.rs:86:15 | LL | fn f5(&(X(_t), X(_u)): &(X, X)) { } | ^^ ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/duplicate-suggestions.rs:148:11 + --> $DIR/duplicate-suggestions.rs:146:11 | LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } | ^^^^^^^^--^^^^^--^^ @@ -318,7 +318,7 @@ LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } | help: consider removing the `&mut`: `(X(_t), X(_u))` | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/duplicate-suggestions.rs:148:19 + --> $DIR/duplicate-suggestions.rs:146:19 | LL | fn f6(&mut (X(_t), X(_u)): &mut (X, X)) { } | ^^ ^^ diff --git a/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.rs b/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.rs index 90a9fe4e7d0..6e3879a4155 100644 --- a/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.rs +++ b/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - #[derive(Clone)] enum Either { One(X), diff --git a/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr b/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr index f1d515e932c..74f3a63be57 100644 --- a/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr +++ b/src/test/ui/suggestions/dont-suggest-ref/move-into-closure.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:30:21 + --> $DIR/move-into-closure.rs:28:21 | LL | let x = X(Y); | - captured outer variable @@ -12,13 +12,13 @@ LL | let X(_t) = x; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:30:15 + --> $DIR/move-into-closure.rs:28:15 | LL | let X(_t) = x; | ^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:34:34 + --> $DIR/move-into-closure.rs:32:34 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -31,13 +31,13 @@ LL | if let Either::One(_t) = e { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:34:28 + --> $DIR/move-into-closure.rs:32:28 | LL | if let Either::One(_t) = e { } | ^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:38:37 + --> $DIR/move-into-closure.rs:36:37 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -50,13 +50,13 @@ LL | while let Either::One(_t) = e { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:38:31 + --> $DIR/move-into-closure.rs:36:31 | LL | while let Either::One(_t) = e { } | ^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:42:15 + --> $DIR/move-into-closure.rs:40:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -71,13 +71,13 @@ LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:46:25 + --> $DIR/move-into-closure.rs:44:25 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:49:15 + --> $DIR/move-into-closure.rs:47:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -92,13 +92,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:53:25 + --> $DIR/move-into-closure.rs:51:25 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:58:25 + --> $DIR/move-into-closure.rs:56:25 | LL | let x = X(Y); | - captured outer variable @@ -111,13 +111,13 @@ LL | let X(mut _t) = x; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:58:15 + --> $DIR/move-into-closure.rs:56:15 | LL | let X(mut _t) = x; | ^^^^^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:62:38 + --> $DIR/move-into-closure.rs:60:38 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -130,13 +130,13 @@ LL | if let Either::One(mut _t) = em { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:62:28 + --> $DIR/move-into-closure.rs:60:28 | LL | if let Either::One(mut _t) = em { } | ^^^^^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:66:41 + --> $DIR/move-into-closure.rs:64:41 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -149,13 +149,13 @@ LL | while let Either::One(mut _t) = em { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:66:31 + --> $DIR/move-into-closure.rs:64:31 | LL | while let Either::One(mut _t) = em { } | ^^^^^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:70:15 + --> $DIR/move-into-closure.rs:68:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -170,13 +170,13 @@ LL | Either::One(mut _t) | ------ data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:74:25 + --> $DIR/move-into-closure.rs:72:25 | LL | Either::One(mut _t) | ^^^^^^ error[E0507]: cannot move out of captured variable in an `Fn` closure - --> $DIR/move-into-closure.rs:77:15 + --> $DIR/move-into-closure.rs:75:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -191,13 +191,13 @@ LL | Either::One(mut _t) => (), | ------ data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:81:25 + --> $DIR/move-into-closure.rs:79:25 | LL | Either::One(mut _t) => (), | ^^^^^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:97:21 + --> $DIR/move-into-closure.rs:95:21 | LL | let x = X(Y); | - captured outer variable @@ -210,13 +210,13 @@ LL | let X(_t) = x; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:97:15 + --> $DIR/move-into-closure.rs:95:15 | LL | let X(_t) = x; | ^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:101:34 + --> $DIR/move-into-closure.rs:99:34 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -229,13 +229,13 @@ LL | if let Either::One(_t) = e { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:101:28 + --> $DIR/move-into-closure.rs:99:28 | LL | if let Either::One(_t) = e { } | ^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:105:37 + --> $DIR/move-into-closure.rs:103:37 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -248,13 +248,13 @@ LL | while let Either::One(_t) = e { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:105:31 + --> $DIR/move-into-closure.rs:103:31 | LL | while let Either::One(_t) = e { } | ^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:109:15 + --> $DIR/move-into-closure.rs:107:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -269,13 +269,13 @@ LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:113:25 + --> $DIR/move-into-closure.rs:111:25 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:116:15 + --> $DIR/move-into-closure.rs:114:15 | LL | let e = Either::One(X(Y)); | - captured outer variable @@ -290,13 +290,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:120:25 + --> $DIR/move-into-closure.rs:118:25 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:125:25 + --> $DIR/move-into-closure.rs:123:25 | LL | let x = X(Y); | - captured outer variable @@ -309,13 +309,13 @@ LL | let X(mut _t) = x; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:125:15 + --> $DIR/move-into-closure.rs:123:15 | LL | let X(mut _t) = x; | ^^^^^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:129:38 + --> $DIR/move-into-closure.rs:127:38 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -328,13 +328,13 @@ LL | if let Either::One(mut _t) = em { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:129:28 + --> $DIR/move-into-closure.rs:127:28 | LL | if let Either::One(mut _t) = em { } | ^^^^^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:133:41 + --> $DIR/move-into-closure.rs:131:41 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -347,13 +347,13 @@ LL | while let Either::One(mut _t) = em { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:133:31 + --> $DIR/move-into-closure.rs:131:31 | LL | while let Either::One(mut _t) = em { } | ^^^^^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:137:15 + --> $DIR/move-into-closure.rs:135:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -368,13 +368,13 @@ LL | Either::One(mut _t) | ------ data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:141:25 + --> $DIR/move-into-closure.rs:139:25 | LL | Either::One(mut _t) | ^^^^^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:144:15 + --> $DIR/move-into-closure.rs:142:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -389,13 +389,13 @@ LL | Either::One(mut _t) => (), | ------ data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:148:25 + --> $DIR/move-into-closure.rs:146:25 | LL | Either::One(mut _t) => (), | ^^^^^^ error[E0507]: cannot move out of captured variable in an `FnMut` closure - --> $DIR/move-into-closure.rs:152:15 + --> $DIR/move-into-closure.rs:150:15 | LL | let mut em = Either::One(X(Y)); | ------ captured outer variable @@ -410,7 +410,7 @@ LL | Either::One(mut _t) => (), | ------ data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/move-into-closure.rs:156:25 + --> $DIR/move-into-closure.rs:154:25 | LL | Either::One(mut _t) => (), | ^^^^^^ diff --git a/src/test/ui/suggestions/dont-suggest-ref/simple.rs b/src/test/ui/suggestions/dont-suggest-ref/simple.rs index 58aab85ac26..31ab1a6639a 100644 --- a/src/test/ui/suggestions/dont-suggest-ref/simple.rs +++ b/src/test/ui/suggestions/dont-suggest-ref/simple.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - #[derive(Clone)] enum Either { One(X), diff --git a/src/test/ui/suggestions/dont-suggest-ref/simple.stderr b/src/test/ui/suggestions/dont-suggest-ref/simple.stderr index 6a8b17ca870..7f2ba4da714 100644 --- a/src/test/ui/suggestions/dont-suggest-ref/simple.stderr +++ b/src/test/ui/suggestions/dont-suggest-ref/simple.stderr @@ -1,5 +1,5 @@ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:40:17 + --> $DIR/simple.rs:38:17 | LL | let X(_t) = *s; | -- ^^ @@ -9,13 +9,13 @@ LL | let X(_t) = *s; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:40:11 + --> $DIR/simple.rs:38:11 | LL | let X(_t) = *s; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:44:30 + --> $DIR/simple.rs:42:30 | LL | if let Either::One(_t) = *r { } | -- ^^ @@ -25,13 +25,13 @@ LL | if let Either::One(_t) = *r { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:44:24 + --> $DIR/simple.rs:42:24 | LL | if let Either::One(_t) = *r { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:48:33 + --> $DIR/simple.rs:46:33 | LL | while let Either::One(_t) = *r { } | -- ^^ @@ -41,13 +41,13 @@ LL | while let Either::One(_t) = *r { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:48:27 + --> $DIR/simple.rs:46:27 | LL | while let Either::One(_t) = *r { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:52:11 + --> $DIR/simple.rs:50:11 | LL | match *r { | ^^ @@ -59,13 +59,13 @@ LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:56:21 + --> $DIR/simple.rs:54:21 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:59:11 + --> $DIR/simple.rs:57:11 | LL | match *r { | ^^ @@ -77,13 +77,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:63:21 + --> $DIR/simple.rs:61:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:68:17 + --> $DIR/simple.rs:66:17 | LL | let X(_t) = *sm; | -- ^^^ @@ -93,13 +93,13 @@ LL | let X(_t) = *sm; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:68:11 + --> $DIR/simple.rs:66:11 | LL | let X(_t) = *sm; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:72:30 + --> $DIR/simple.rs:70:30 | LL | if let Either::One(_t) = *rm { } | -- ^^^ @@ -109,13 +109,13 @@ LL | if let Either::One(_t) = *rm { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:72:24 + --> $DIR/simple.rs:70:24 | LL | if let Either::One(_t) = *rm { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:76:33 + --> $DIR/simple.rs:74:33 | LL | while let Either::One(_t) = *rm { } | -- ^^^ @@ -125,13 +125,13 @@ LL | while let Either::One(_t) = *rm { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:76:27 + --> $DIR/simple.rs:74:27 | LL | while let Either::One(_t) = *rm { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:80:11 + --> $DIR/simple.rs:78:11 | LL | match *rm { | ^^^ @@ -143,13 +143,13 @@ LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:84:21 + --> $DIR/simple.rs:82:21 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:87:11 + --> $DIR/simple.rs:85:11 | LL | match *rm { | ^^^ @@ -161,13 +161,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:91:21 + --> $DIR/simple.rs:89:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:95:11 + --> $DIR/simple.rs:93:11 | LL | match *rm { | ^^^ @@ -179,13 +179,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:99:21 + --> $DIR/simple.rs:97:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:104:17 + --> $DIR/simple.rs:102:17 | LL | let X(_t) = vs[0]; | -- ^^^^^ @@ -195,13 +195,13 @@ LL | let X(_t) = vs[0]; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:104:11 + --> $DIR/simple.rs:102:11 | LL | let X(_t) = vs[0]; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:108:30 + --> $DIR/simple.rs:106:30 | LL | if let Either::One(_t) = vr[0] { } | -- ^^^^^ @@ -211,13 +211,13 @@ LL | if let Either::One(_t) = vr[0] { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:108:24 + --> $DIR/simple.rs:106:24 | LL | if let Either::One(_t) = vr[0] { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:112:33 + --> $DIR/simple.rs:110:33 | LL | while let Either::One(_t) = vr[0] { } | -- ^^^^^ @@ -227,13 +227,13 @@ LL | while let Either::One(_t) = vr[0] { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:112:27 + --> $DIR/simple.rs:110:27 | LL | while let Either::One(_t) = vr[0] { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:116:11 + --> $DIR/simple.rs:114:11 | LL | match vr[0] { | ^^^^^ @@ -245,13 +245,13 @@ LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:120:21 + --> $DIR/simple.rs:118:21 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:123:11 + --> $DIR/simple.rs:121:11 | LL | match vr[0] { | ^^^^^ @@ -263,13 +263,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:127:21 + --> $DIR/simple.rs:125:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:132:17 + --> $DIR/simple.rs:130:17 | LL | let X(_t) = vsm[0]; | -- ^^^^^^ @@ -279,13 +279,13 @@ LL | let X(_t) = vsm[0]; | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:132:11 + --> $DIR/simple.rs:130:11 | LL | let X(_t) = vsm[0]; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:136:30 + --> $DIR/simple.rs:134:30 | LL | if let Either::One(_t) = vrm[0] { } | -- ^^^^^^ @@ -295,13 +295,13 @@ LL | if let Either::One(_t) = vrm[0] { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:136:24 + --> $DIR/simple.rs:134:24 | LL | if let Either::One(_t) = vrm[0] { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:140:33 + --> $DIR/simple.rs:138:33 | LL | while let Either::One(_t) = vrm[0] { } | -- ^^^^^^ @@ -311,13 +311,13 @@ LL | while let Either::One(_t) = vrm[0] { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:140:27 + --> $DIR/simple.rs:138:27 | LL | while let Either::One(_t) = vrm[0] { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:144:11 + --> $DIR/simple.rs:142:11 | LL | match vrm[0] { | ^^^^^^ @@ -329,13 +329,13 @@ LL | Either::One(_t) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:148:21 + --> $DIR/simple.rs:146:21 | LL | Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:151:11 + --> $DIR/simple.rs:149:11 | LL | match vrm[0] { | ^^^^^^ @@ -347,13 +347,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:155:21 + --> $DIR/simple.rs:153:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:159:11 + --> $DIR/simple.rs:157:11 | LL | match vrm[0] { | ^^^^^^ @@ -365,13 +365,13 @@ LL | Either::One(_t) => (), | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:163:21 + --> $DIR/simple.rs:161:21 | LL | Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:170:18 + --> $DIR/simple.rs:168:18 | LL | let &X(_t) = s; | ------ ^ cannot move out of borrowed content @@ -380,13 +380,13 @@ LL | let &X(_t) = s; | help: consider removing the `&`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:170:12 + --> $DIR/simple.rs:168:12 | LL | let &X(_t) = s; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:174:31 + --> $DIR/simple.rs:172:31 | LL | if let &Either::One(_t) = r { } | ---------------- ^ cannot move out of borrowed content @@ -395,13 +395,13 @@ LL | if let &Either::One(_t) = r { } | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:174:25 + --> $DIR/simple.rs:172:25 | LL | if let &Either::One(_t) = r { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:178:34 + --> $DIR/simple.rs:176:34 | LL | while let &Either::One(_t) = r { } | ---------------- ^ cannot move out of borrowed content @@ -410,13 +410,13 @@ LL | while let &Either::One(_t) = r { } | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:178:28 + --> $DIR/simple.rs:176:28 | LL | while let &Either::One(_t) = r { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:182:11 + --> $DIR/simple.rs:180:11 | LL | match r { | ^ cannot move out of borrowed content @@ -428,13 +428,13 @@ LL | &Either::One(_t) | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:184:22 + --> $DIR/simple.rs:182:22 | LL | &Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:190:11 + --> $DIR/simple.rs:188:11 | LL | match r { | ^ cannot move out of borrowed content @@ -446,13 +446,13 @@ LL | &Either::One(_t) => (), | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:192:22 + --> $DIR/simple.rs:190:22 | LL | &Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:197:11 + --> $DIR/simple.rs:195:11 | LL | match r { | ^ cannot move out of borrowed content @@ -464,13 +464,13 @@ LL | &Either::One(_t) => (), | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:199:22 + --> $DIR/simple.rs:197:22 | LL | &Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:209:22 + --> $DIR/simple.rs:207:22 | LL | let &mut X(_t) = sm; | ---------- ^^ cannot move out of borrowed content @@ -479,13 +479,13 @@ LL | let &mut X(_t) = sm; | help: consider removing the `&mut`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:209:16 + --> $DIR/simple.rs:207:16 | LL | let &mut X(_t) = sm; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:213:35 + --> $DIR/simple.rs:211:35 | LL | if let &mut Either::One(_t) = rm { } | -------------------- ^^ cannot move out of borrowed content @@ -494,13 +494,13 @@ LL | if let &mut Either::One(_t) = rm { } | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:213:29 + --> $DIR/simple.rs:211:29 | LL | if let &mut Either::One(_t) = rm { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:217:38 + --> $DIR/simple.rs:215:38 | LL | while let &mut Either::One(_t) = rm { } | -------------------- ^^ cannot move out of borrowed content @@ -509,13 +509,13 @@ LL | while let &mut Either::One(_t) = rm { } | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:217:32 + --> $DIR/simple.rs:215:32 | LL | while let &mut Either::One(_t) = rm { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:221:11 + --> $DIR/simple.rs:219:11 | LL | match rm { | ^^ cannot move out of borrowed content @@ -527,7 +527,7 @@ LL | &mut Either::Two(_t) => (), | -- ...and here | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/simple.rs:223:26 + --> $DIR/simple.rs:221:26 | LL | &mut Either::One(_t) => (), | ^^ @@ -544,7 +544,7 @@ LL | Either::Two(_t) => (), | ^^^^^^^^^^^^^^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:230:11 + --> $DIR/simple.rs:228:11 | LL | match rm { | ^^ cannot move out of borrowed content @@ -556,13 +556,13 @@ LL | &mut Either::One(_t) => (), | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:232:26 + --> $DIR/simple.rs:230:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:237:11 + --> $DIR/simple.rs:235:11 | LL | match rm { | ^^ cannot move out of borrowed content @@ -574,13 +574,13 @@ LL | &mut Either::One(_t) => (), | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:239:26 + --> $DIR/simple.rs:237:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:244:11 + --> $DIR/simple.rs:242:11 | LL | match rm { | ^^ cannot move out of borrowed content @@ -592,13 +592,13 @@ LL | &mut Either::One(_t) => (), | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:246:26 + --> $DIR/simple.rs:244:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:260:21 + --> $DIR/simple.rs:258:21 | LL | let (&X(_t),) = (&x.clone(),); | -- ^^^^^^^^^^^^^ cannot move out of borrowed content @@ -606,13 +606,13 @@ LL | let (&X(_t),) = (&x.clone(),); | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:260:13 + --> $DIR/simple.rs:258:13 | LL | let (&X(_t),) = (&x.clone(),); | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:262:34 + --> $DIR/simple.rs:260:34 | LL | if let (&Either::One(_t),) = (&e.clone(),) { } | -- ^^^^^^^^^^^^^ cannot move out of borrowed content @@ -620,13 +620,13 @@ LL | if let (&Either::One(_t),) = (&e.clone(),) { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:262:26 + --> $DIR/simple.rs:260:26 | LL | if let (&Either::One(_t),) = (&e.clone(),) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:264:37 + --> $DIR/simple.rs:262:37 | LL | while let (&Either::One(_t),) = (&e.clone(),) { } | -- ^^^^^^^^^^^^^ cannot move out of borrowed content @@ -634,13 +634,13 @@ LL | while let (&Either::One(_t),) = (&e.clone(),) { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:264:29 + --> $DIR/simple.rs:262:29 | LL | while let (&Either::One(_t),) = (&e.clone(),) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:266:11 + --> $DIR/simple.rs:264:11 | LL | match (&e.clone(),) { | ^^^^^^^^^^^^^ cannot move out of borrowed content @@ -649,13 +649,13 @@ LL | (&Either::One(_t),) | -- data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:268:23 + --> $DIR/simple.rs:266:23 | LL | (&Either::One(_t),) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:274:25 + --> $DIR/simple.rs:272:25 | LL | let (&mut X(_t),) = (&mut xm.clone(),); | -- ^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -663,13 +663,13 @@ LL | let (&mut X(_t),) = (&mut xm.clone(),); | data moved here | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:274:17 + --> $DIR/simple.rs:272:17 | LL | let (&mut X(_t),) = (&mut xm.clone(),); | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:276:38 + --> $DIR/simple.rs:274:38 | LL | if let (&mut Either::One(_t),) = (&mut em.clone(),) { } | -- ^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -677,13 +677,13 @@ LL | if let (&mut Either::One(_t),) = (&mut em.clone(),) { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:276:30 + --> $DIR/simple.rs:274:30 | LL | if let (&mut Either::One(_t),) = (&mut em.clone(),) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:278:41 + --> $DIR/simple.rs:276:41 | LL | while let (&mut Either::One(_t),) = (&mut em.clone(),) { } | -- ^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -691,13 +691,13 @@ LL | while let (&mut Either::One(_t),) = (&mut em.clone(),) { } | data moved here | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:278:33 + --> $DIR/simple.rs:276:33 | LL | while let (&mut Either::One(_t),) = (&mut em.clone(),) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:280:11 + --> $DIR/simple.rs:278:11 | LL | match (&mut em.clone(),) { | ^^^^^^^^^^^^^^^^^^ cannot move out of borrowed content @@ -708,7 +708,7 @@ LL | (&mut Either::Two(_t),) => (), | -- ...and here | note: move occurs because these variables have types that don't implement the `Copy` trait - --> $DIR/simple.rs:282:27 + --> $DIR/simple.rs:280:27 | LL | (&mut Either::One(_t),) => (), | ^^ @@ -716,7 +716,7 @@ LL | (&mut Either::Two(_t),) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:290:18 + --> $DIR/simple.rs:288:18 | LL | let &X(_t) = &x; | ------ ^^ cannot move out of borrowed content @@ -725,13 +725,13 @@ LL | let &X(_t) = &x; | help: consider removing the `&`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:290:12 + --> $DIR/simple.rs:288:12 | LL | let &X(_t) = &x; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:294:31 + --> $DIR/simple.rs:292:31 | LL | if let &Either::One(_t) = &e { } | ---------------- ^^ cannot move out of borrowed content @@ -740,13 +740,13 @@ LL | if let &Either::One(_t) = &e { } | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:294:25 + --> $DIR/simple.rs:292:25 | LL | if let &Either::One(_t) = &e { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:298:34 + --> $DIR/simple.rs:296:34 | LL | while let &Either::One(_t) = &e { } | ---------------- ^^ cannot move out of borrowed content @@ -755,13 +755,13 @@ LL | while let &Either::One(_t) = &e { } | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:298:28 + --> $DIR/simple.rs:296:28 | LL | while let &Either::One(_t) = &e { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:302:11 + --> $DIR/simple.rs:300:11 | LL | match &e { | ^^ cannot move out of borrowed content @@ -773,13 +773,13 @@ LL | &Either::One(_t) | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:304:22 + --> $DIR/simple.rs:302:22 | LL | &Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:310:11 + --> $DIR/simple.rs:308:11 | LL | match &e { | ^^ cannot move out of borrowed content @@ -791,13 +791,13 @@ LL | &Either::One(_t) => (), | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:312:22 + --> $DIR/simple.rs:310:22 | LL | &Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:317:11 + --> $DIR/simple.rs:315:11 | LL | match &e { | ^^ cannot move out of borrowed content @@ -809,13 +809,13 @@ LL | &Either::One(_t) => (), | help: consider removing the `&`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:319:22 + --> $DIR/simple.rs:317:22 | LL | &Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:325:22 + --> $DIR/simple.rs:323:22 | LL | let &mut X(_t) = &mut xm; | ---------- ^^^^^^^ cannot move out of borrowed content @@ -824,13 +824,13 @@ LL | let &mut X(_t) = &mut xm; | help: consider removing the `&mut`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:325:16 + --> $DIR/simple.rs:323:16 | LL | let &mut X(_t) = &mut xm; | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:329:35 + --> $DIR/simple.rs:327:35 | LL | if let &mut Either::One(_t) = &mut em { } | -------------------- ^^^^^^^ cannot move out of borrowed content @@ -839,13 +839,13 @@ LL | if let &mut Either::One(_t) = &mut em { } | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:329:29 + --> $DIR/simple.rs:327:29 | LL | if let &mut Either::One(_t) = &mut em { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:333:38 + --> $DIR/simple.rs:331:38 | LL | while let &mut Either::One(_t) = &mut em { } | -------------------- ^^^^^^^ cannot move out of borrowed content @@ -854,13 +854,13 @@ LL | while let &mut Either::One(_t) = &mut em { } | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:333:32 + --> $DIR/simple.rs:331:32 | LL | while let &mut Either::One(_t) = &mut em { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:337:11 + --> $DIR/simple.rs:335:11 | LL | match &mut em { | ^^^^^^^ cannot move out of borrowed content @@ -872,13 +872,13 @@ LL | &mut Either::One(_t) | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:339:26 + --> $DIR/simple.rs:337:26 | LL | &mut Either::One(_t) | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:345:11 + --> $DIR/simple.rs:343:11 | LL | match &mut em { | ^^^^^^^ cannot move out of borrowed content @@ -890,13 +890,13 @@ LL | &mut Either::One(_t) => (), | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:347:26 + --> $DIR/simple.rs:345:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:352:11 + --> $DIR/simple.rs:350:11 | LL | match &mut em { | ^^^^^^^ cannot move out of borrowed content @@ -908,13 +908,13 @@ LL | &mut Either::One(_t) => (), | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:354:26 + --> $DIR/simple.rs:352:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:359:11 + --> $DIR/simple.rs:357:11 | LL | match &mut em { | ^^^^^^^ cannot move out of borrowed content @@ -926,13 +926,13 @@ LL | &mut Either::One(_t) => (), | help: consider removing the `&mut`: `Either::One(_t)` | note: move occurs because `_t` has type `X`, which does not implement the `Copy` trait - --> $DIR/simple.rs:361:26 + --> $DIR/simple.rs:359:26 | LL | &mut Either::One(_t) => (), | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:204:11 + --> $DIR/simple.rs:202:11 | LL | fn f1(&X(_t): &X) { } | ^^^--^ @@ -942,13 +942,13 @@ LL | fn f1(&X(_t): &X) { } | help: consider removing the `&`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:204:14 + --> $DIR/simple.rs:202:14 | LL | fn f1(&X(_t): &X) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:251:11 + --> $DIR/simple.rs:249:11 | LL | fn f2(&mut X(_t): &mut X) { } | ^^^^^^^--^ @@ -958,13 +958,13 @@ LL | fn f2(&mut X(_t): &mut X) { } | help: consider removing the `&mut`: `X(_t)` | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:251:18 + --> $DIR/simple.rs:249:18 | LL | fn f2(&mut X(_t): &mut X) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:271:11 + --> $DIR/simple.rs:269:11 | LL | fn f3((&X(_t),): (&X,)) { } | ^^^^--^^^ @@ -973,13 +973,13 @@ LL | fn f3((&X(_t),): (&X,)) { } | cannot move out of borrowed content | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:271:15 + --> $DIR/simple.rs:269:15 | LL | fn f3((&X(_t),): (&X,)) { } | ^^ error[E0507]: cannot move out of borrowed content - --> $DIR/simple.rs:285:11 + --> $DIR/simple.rs:283:11 | LL | fn f4((&mut X(_t),): (&mut X,)) { } | ^^^^^^^^--^^^ @@ -988,7 +988,7 @@ LL | fn f4((&mut X(_t),): (&mut X,)) { } | cannot move out of borrowed content | note: move occurs because `_t` has type `Y`, which does not implement the `Copy` trait - --> $DIR/simple.rs:285:19 + --> $DIR/simple.rs:283:19 | LL | fn f4((&mut X(_t),): (&mut X,)) { } | ^^ diff --git a/src/test/ui/suggestions/suggest-ref-mut.rs b/src/test/ui/suggestions/suggest-ref-mut.rs index b4a6fa39f90..d04113ffccc 100644 --- a/src/test/ui/suggestions/suggest-ref-mut.rs +++ b/src/test/ui/suggestions/suggest-ref-mut.rs @@ -1,5 +1,3 @@ -#![feature(nll)] - struct X(usize); impl X { diff --git a/src/test/ui/suggestions/suggest-ref-mut.stderr b/src/test/ui/suggestions/suggest-ref-mut.stderr index 3dd9fbc6f14..24143678757 100644 --- a/src/test/ui/suggestions/suggest-ref-mut.stderr +++ b/src/test/ui/suggestions/suggest-ref-mut.stderr @@ -1,5 +1,5 @@ error[E0594]: cannot assign to `self.0` which is behind a `&` reference - --> $DIR/suggest-ref-mut.rs:9:9 + --> $DIR/suggest-ref-mut.rs:7:9 | LL | fn zap(&self) { | ----- help: consider changing this to be a mutable reference: `&mut self` @@ -8,7 +8,7 @@ LL | self.0 = 32; | ^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be written error[E0594]: cannot assign to `*foo` which is behind a `&` reference - --> $DIR/suggest-ref-mut.rs:18:5 + --> $DIR/suggest-ref-mut.rs:16:5 | LL | let ref foo = 16; | ------- help: consider changing this to be a mutable reference: `ref mut foo` @@ -17,7 +17,7 @@ LL | *foo = 32; | ^^^^^^^^^ `foo` is a `&` reference, so the data it refers to cannot be written error[E0594]: cannot assign to `*bar` which is behind a `&` reference - --> $DIR/suggest-ref-mut.rs:23:9 + --> $DIR/suggest-ref-mut.rs:21:9 | LL | if let Some(ref bar) = Some(16) { | ------- help: consider changing this to be a mutable reference: `ref mut bar` @@ -26,7 +26,7 @@ LL | *bar = 32; | ^^^^^^^^^ `bar` is a `&` reference, so the data it refers to cannot be written error[E0594]: cannot assign to `*quo` which is behind a `&` reference - --> $DIR/suggest-ref-mut.rs:27:22 + --> $DIR/suggest-ref-mut.rs:25:22 | LL | ref quo => { *quo = 32; }, | ------- ^^^^^^^^^ `quo` is a `&` reference, so the data it refers to cannot be written