diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index f7c20542cbf2e..6c076265db639 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -708,7 +708,7 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { fn bckerr_to_diag(&self, err: &BckError<'tcx>) -> DiagnosticBuilder<'a> { let span = err.span.clone(); - let msg = match err.code { + match err.code { err_mutbl => { let descr = match err.cmt.note { mc::NoteClosureEnv(_) | mc::NoteUpvarRef(_) => { @@ -732,10 +732,11 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { match err.cause { MutabilityViolation => { - format!("cannot assign to {}", descr) + struct_span_err!(self.tcx.sess, span, E0594, "cannot assign to {}", descr) } BorrowViolation(euv::ClosureCapture(_)) => { - format!("closure cannot assign to {}", descr) + struct_span_err!(self.tcx.sess, span, E0595, + "closure cannot assign to {}", descr) } BorrowViolation(euv::OverloadedOperator) | BorrowViolation(euv::AddrOf) | @@ -744,7 +745,8 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { BorrowViolation(euv::AutoUnsafe) | BorrowViolation(euv::ForLoop) | BorrowViolation(euv::MatchDiscriminant) => { - format!("cannot borrow {} as mutable", descr) + struct_span_err!(self.tcx.sess, span, E0596, + "cannot borrow {} as mutable", descr) } BorrowViolation(euv::ClosureInvocation) => { span_bug!(err.span, @@ -759,17 +761,16 @@ impl<'a, 'tcx> BorrowckCtxt<'a, 'tcx> { format!("`{}`", self.loan_path_to_string(&lp)) } }; - format!("{} does not live long enough", msg) + struct_span_err!(self.tcx.sess, span, E0597, "{} does not live long enough", msg) } err_borrowed_pointer_too_short(..) => { let descr = self.cmt_to_path_or_string(&err.cmt); - format!("lifetime of {} is too short to guarantee \ - its contents can be safely reborrowed", - descr) + struct_span_err!(self.tcx.sess, span, E0598, + "lifetime of {} is too short to guarantee \ + its contents can be safely reborrowed", + descr) } - }; - - self.struct_span_err(span, &msg) + } } pub fn report_aliasability_violation(&self, @@ -1176,7 +1177,7 @@ before rustc 1.16, this temporary lived longer - see issue #39283 \ if kind == ty::ClosureKind::Fn { db.span_help(self.tcx.hir.span(upvar_id.closure_expr_id), "consider changing this closure to take \ - self by mutable reference"); + self by mutable reference"); } } _ => { diff --git a/src/librustc_borrowck/diagnostics.rs b/src/librustc_borrowck/diagnostics.rs index bfd342a9f2134..2a38dcfd26e1a 100644 --- a/src/librustc_borrowck/diagnostics.rs +++ b/src/librustc_borrowck/diagnostics.rs @@ -1114,9 +1114,63 @@ fn main() { ``` "##, +E0596: r##" +This error occurs because you tried to mutably borrow a non-mutable variable. + +Example of erroneous code: + +```compile_fail,E0596 +let x = 1; +let y = &mut x; // error: cannot borrow mutably +``` + +In here, `x` isn't mutable, so when we try to mutably borrow it in `y`, it +fails. To fix this error, you need to make `x` mutable: + +``` +let mut x = 1; +let y = &mut x; // ok! +``` +"##, + +E0597: r##" +This error occurs because a borrow was made inside a variable which has a +greater lifetime than the borrowed one. + +Example of erroneous code: + +```compile_fail,E0597 +struct Foo<'a> { + x: Option<&'a u32>, +} + +let mut x = Foo { x: None }; +let y = 0; +x.x = Some(&y); // error: `y` does not live long enough +``` + +In here, `x` is created before `y` and therefore has a greater lifetime. Always +keep in mind that values in a scope are dropped in the opposite order they are +created. So to fix the previous example, just make the `y` lifetime greater than +the `x`'s one: + +``` +struct Foo<'a> { + x: Option<&'a u32>, +} + +let y = 0; +let mut x = Foo { x: None }; +x.x = Some(&y); +``` +"##, + } register_diagnostics! { // E0385, // {} in an aliasable location E0524, // two closures require unique access to `..` at the same time + E0594, // cannot assign to {} + E0595, // closure cannot assign to {} + E0598, // lifetime of {} is too short to guarantee its contents can be... } diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index edaaa863ecc34..594f1813a5ab4 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -165,18 +165,21 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { .. }) => { let tcx = self.tcx; - let mut err = self.type_error_struct(span, - |actual| { - format!("no {} named `{}` found for type `{}` in the current scope", - if mode == Mode::MethodCall { - "method" - } else { - "associated item" - }, - item_name, - actual) - }, - rcvr_ty); + let actual = self.resolve_type_vars_if_possible(&rcvr_ty); + let mut err = if !actual.references_error() { + struct_span_err!(tcx.sess, span, E0599, + "no {} named `{}` found for type `{}` in the \ + current scope", + if mode == Mode::MethodCall { + "method" + } else { + "associated item" + }, + item_name, + self.ty_to_string(actual)) + } else { + self.tcx.sess.diagnostic().struct_dummy() + }; // If the method name is the name of a field with a function or closure type, // give a helping note that it has to be called as (x.f)(...). diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs index 59cb61d9b97f0..3709260acc997 100644 --- a/src/librustc_typeck/check/op.rs +++ b/src/librustc_typeck/check/op.rs @@ -316,10 +316,12 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { match self.lookup_op_method(ex, operand_ty, vec![], mname, trait_did, operand_expr) { Ok(t) => t, Err(()) => { - self.type_error_message(ex.span, |actual| { - format!("cannot apply unary operator `{}` to type `{}`", - op_str, actual) - }, operand_ty); + let actual = self.resolve_type_vars_if_possible(&operand_ty); + if !actual.references_error() { + struct_span_err!(self.tcx.sess, ex.span, E0600, + "cannot apply unary operator `{}` to type `{}`", + op_str, actual).emit(); + } self.tcx.types.err } } diff --git a/src/librustc_typeck/diagnostics.rs b/src/librustc_typeck/diagnostics.rs index f9ebe3fff5beb..f19eb19427611 100644 --- a/src/librustc_typeck/diagnostics.rs +++ b/src/librustc_typeck/diagnostics.rs @@ -4005,7 +4005,7 @@ details. [issue #33685]: https://github.com/rust-lang/rust/issues/33685 "##, - E0582: r##" +E0582: r##" A lifetime appears only in an associated-type binding, and not in the input types to the trait. @@ -4042,6 +4042,59 @@ details. [issue #33685]: https://github.com/rust-lang/rust/issues/33685 "##, +E0599: r##" +```compile_fail,E0599 +struct Mouth; + +let x = Mouth; +x.chocolate(); // error: no method named `chocolate` found for type `Mouth` + // in the current scope +``` +"##, + +E0600: r##" +An unary operator was used on a type which doesn't implement it. + +Example of erroneous code: + +```compile_fail,E0600 +enum Question { + Yes, + No, +} + +!Question::Yes; // error: cannot apply unary operator `!` to type `Question` +``` + +In this case, `Question` would need to implement the `std::ops::Not` trait in +order to be able to use `!` on it. Let's implement it: + +``` +use std::ops::Not; + +enum Question { + Yes, + No, +} + +// We implement the `Not` trait on the enum. +impl Not for Question { + type Output = bool; + + fn not(self) -> bool { + match self { + Question::Yes => false, // If the `Answer` is `Yes`, then it + // returns false. + Question::No => true, // And here we do the opposite. + } + } +} + +assert_eq!(!Question::Yes, false); +assert_eq!(!Question::No, true); +``` +"##, + } register_diagnostics! { diff --git a/src/test/compile-fail/E0596.rs b/src/test/compile-fail/E0596.rs new file mode 100644 index 0000000000000..1f1af69d97768 --- /dev/null +++ b/src/test/compile-fail/E0596.rs @@ -0,0 +1,14 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let x = 1; + let y = &mut x; //~ ERROR E0596 +} diff --git a/src/test/compile-fail/E0597.rs b/src/test/compile-fail/E0597.rs new file mode 100644 index 0000000000000..00ef14a8e2af0 --- /dev/null +++ b/src/test/compile-fail/E0597.rs @@ -0,0 +1,19 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +struct Foo<'a> { + x: Option<&'a u32>, +} + +fn main() { + let mut x = Foo { x: None }; + let y = 0; + x.x = Some(&y); +} //~ `y` does not live long enough [E0597] diff --git a/src/test/compile-fail/E0600.rs b/src/test/compile-fail/E0600.rs new file mode 100644 index 0000000000000..5457ff266086f --- /dev/null +++ b/src/test/compile-fail/E0600.rs @@ -0,0 +1,13 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + !"a"; //~ ERROR E0600 +} diff --git a/src/test/ui/codemap_tests/huge_multispan_highlight.stderr b/src/test/ui/codemap_tests/huge_multispan_highlight.stderr index 059215157ec52..46b3db18e8a5c 100644 --- a/src/test/ui/codemap_tests/huge_multispan_highlight.stderr +++ b/src/test/ui/codemap_tests/huge_multispan_highlight.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable local variable `x` as mutable +error[E0596]: cannot borrow immutable local variable `x` as mutable --> $DIR/huge_multispan_highlight.rs:100:18 | 12 | let x = "foo"; diff --git a/src/test/ui/codemap_tests/issue-28308.stderr b/src/test/ui/codemap_tests/issue-28308.stderr index 5e611d42a1491..43743b796d5e4 100644 --- a/src/test/ui/codemap_tests/issue-28308.stderr +++ b/src/test/ui/codemap_tests/issue-28308.stderr @@ -1,4 +1,4 @@ -error: cannot apply unary operator `!` to type `&'static str` +error[E0600]: cannot apply unary operator `!` to type `&'static str` --> $DIR/issue-28308.rs:12:5 | 12 | assert!("foo"); diff --git a/src/test/ui/did_you_mean/issue-31424.stderr b/src/test/ui/did_you_mean/issue-31424.stderr index 1bd8d5128337a..eecb164a83fdc 100644 --- a/src/test/ui/did_you_mean/issue-31424.stderr +++ b/src/test/ui/did_you_mean/issue-31424.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable argument `self` as mutable +error[E0596]: cannot borrow immutable argument `self` as mutable --> $DIR/issue-31424.rs:17:15 | 17 | (&mut self).bar(); @@ -7,7 +7,7 @@ error: cannot borrow immutable argument `self` as mutable | try removing `&mut` here | cannot reborrow mutably -error: cannot borrow immutable argument `self` as mutable +error[E0596]: cannot borrow immutable argument `self` as mutable --> $DIR/issue-31424.rs:23:15 | 22 | fn bar(self: &mut Self) { diff --git a/src/test/ui/did_you_mean/issue-34126.stderr b/src/test/ui/did_you_mean/issue-34126.stderr index 606d6b2b25986..d5d6ee133b819 100644 --- a/src/test/ui/did_you_mean/issue-34126.stderr +++ b/src/test/ui/did_you_mean/issue-34126.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable argument `self` as mutable +error[E0596]: cannot borrow immutable argument `self` as mutable --> $DIR/issue-34126.rs:16:23 | 16 | self.run(&mut self); diff --git a/src/test/ui/did_you_mean/issue-34337.stderr b/src/test/ui/did_you_mean/issue-34337.stderr index c32fb56f61be0..2769c74be5ef8 100644 --- a/src/test/ui/did_you_mean/issue-34337.stderr +++ b/src/test/ui/did_you_mean/issue-34337.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable local variable `key` as mutable +error[E0596]: cannot borrow immutable local variable `key` as mutable --> $DIR/issue-34337.rs:16:14 | 16 | get(&mut key); diff --git a/src/test/ui/did_you_mean/issue-35937.stderr b/src/test/ui/did_you_mean/issue-35937.stderr index 09a9b796c6a46..4760d28566fcf 100644 --- a/src/test/ui/did_you_mean/issue-35937.stderr +++ b/src/test/ui/did_you_mean/issue-35937.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable field `f.v` as mutable +error[E0596]: cannot borrow immutable field `f.v` as mutable --> $DIR/issue-35937.rs:17:5 | 16 | let f = Foo { v: Vec::new() }; @@ -6,7 +6,7 @@ error: cannot borrow immutable field `f.v` as mutable 17 | f.v.push("cat".to_string()); | ^^^ cannot mutably borrow immutable field -error: cannot assign to immutable field `s.x` +error[E0594]: cannot assign to immutable field `s.x` --> $DIR/issue-35937.rs:26:5 | 25 | let s = S { x: 42 }; @@ -14,7 +14,7 @@ error: cannot assign to immutable field `s.x` 26 | s.x += 1; | ^^^^^^^^ cannot mutably borrow immutable field -error: cannot assign to immutable field `s.x` +error[E0594]: cannot assign to immutable field `s.x` --> $DIR/issue-35937.rs:30:5 | 29 | fn bar(s: S) { diff --git a/src/test/ui/did_you_mean/issue-37139.stderr b/src/test/ui/did_you_mean/issue-37139.stderr index acbeaafdf798d..6debbaadb1ab1 100644 --- a/src/test/ui/did_you_mean/issue-37139.stderr +++ b/src/test/ui/did_you_mean/issue-37139.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable local variable `x` as mutable +error[E0596]: cannot borrow immutable local variable `x` as mutable --> $DIR/issue-37139.rs:22:23 | 22 | test(&mut x); diff --git a/src/test/ui/did_you_mean/issue-38147-2.stderr b/src/test/ui/did_you_mean/issue-38147-2.stderr index 83d46e3fc4727..2834fc6262fb2 100644 --- a/src/test/ui/did_you_mean/issue-38147-2.stderr +++ b/src/test/ui/did_you_mean/issue-38147-2.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable borrowed content `*self.s` as mutable +error[E0596]: cannot borrow immutable borrowed content `*self.s` as mutable --> $DIR/issue-38147-2.rs:17:9 | 12 | s: &'a String diff --git a/src/test/ui/did_you_mean/issue-38147-3.stderr b/src/test/ui/did_you_mean/issue-38147-3.stderr index ca6f376ffd301..d950e82003cc0 100644 --- a/src/test/ui/did_you_mean/issue-38147-3.stderr +++ b/src/test/ui/did_you_mean/issue-38147-3.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable borrowed content `*self.s` as mutable +error[E0596]: cannot borrow immutable borrowed content `*self.s` as mutable --> $DIR/issue-38147-3.rs:17:9 | 12 | s: &'a String diff --git a/src/test/ui/did_you_mean/issue-39544.stderr b/src/test/ui/did_you_mean/issue-39544.stderr index 9ae240bf420a5..94afe896d5ead 100644 --- a/src/test/ui/did_you_mean/issue-39544.stderr +++ b/src/test/ui/did_you_mean/issue-39544.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable field `z.x` as mutable +error[E0596]: cannot borrow immutable field `z.x` as mutable --> $DIR/issue-39544.rs:21:18 | 20 | let z = Z { x: X::Y }; @@ -6,7 +6,7 @@ error: cannot borrow immutable field `z.x` as mutable 21 | let _ = &mut z.x; | ^^^ cannot mutably borrow immutable field -error: cannot borrow immutable field `self.x` as mutable +error[E0596]: cannot borrow immutable field `self.x` as mutable --> $DIR/issue-39544.rs:26:22 | 25 | fn foo<'z>(&'z self) { @@ -14,7 +14,7 @@ error: cannot borrow immutable field `self.x` as mutable 26 | let _ = &mut self.x; | ^^^^^^ cannot mutably borrow immutable field -error: cannot borrow immutable field `self.x` as mutable +error[E0596]: cannot borrow immutable field `self.x` as mutable --> $DIR/issue-39544.rs:30:22 | 29 | fn foo1(&self, other: &Z) { @@ -22,7 +22,7 @@ error: cannot borrow immutable field `self.x` as mutable 30 | let _ = &mut self.x; | ^^^^^^ cannot mutably borrow immutable field -error: cannot borrow immutable field `other.x` as mutable +error[E0596]: cannot borrow immutable field `other.x` as mutable --> $DIR/issue-39544.rs:31:22 | 29 | fn foo1(&self, other: &Z) { @@ -31,7 +31,7 @@ error: cannot borrow immutable field `other.x` as mutable 31 | let _ = &mut other.x; | ^^^^^^^ cannot mutably borrow immutable field -error: cannot borrow immutable field `self.x` as mutable +error[E0596]: cannot borrow immutable field `self.x` as mutable --> $DIR/issue-39544.rs:35:22 | 34 | fn foo2<'a>(&'a self, other: &Z) { @@ -39,7 +39,7 @@ error: cannot borrow immutable field `self.x` as mutable 35 | let _ = &mut self.x; | ^^^^^^ cannot mutably borrow immutable field -error: cannot borrow immutable field `other.x` as mutable +error[E0596]: cannot borrow immutable field `other.x` as mutable --> $DIR/issue-39544.rs:36:22 | 34 | fn foo2<'a>(&'a self, other: &Z) { @@ -48,7 +48,7 @@ error: cannot borrow immutable field `other.x` as mutable 36 | let _ = &mut other.x; | ^^^^^^^ cannot mutably borrow immutable field -error: cannot borrow immutable field `self.x` as mutable +error[E0596]: cannot borrow immutable field `self.x` as mutable --> $DIR/issue-39544.rs:40:22 | 39 | fn foo3<'a>(self: &'a Self, other: &Z) { @@ -56,7 +56,7 @@ error: cannot borrow immutable field `self.x` as mutable 40 | let _ = &mut self.x; | ^^^^^^ cannot mutably borrow immutable field -error: cannot borrow immutable field `other.x` as mutable +error[E0596]: cannot borrow immutable field `other.x` as mutable --> $DIR/issue-39544.rs:41:22 | 39 | fn foo3<'a>(self: &'a Self, other: &Z) { @@ -65,7 +65,7 @@ error: cannot borrow immutable field `other.x` as mutable 41 | let _ = &mut other.x; | ^^^^^^^ cannot mutably borrow immutable field -error: cannot borrow immutable field `other.x` as mutable +error[E0596]: cannot borrow immutable field `other.x` as mutable --> $DIR/issue-39544.rs:45:22 | 44 | fn foo4(other: &Z) { @@ -73,7 +73,7 @@ error: cannot borrow immutable field `other.x` as mutable 45 | let _ = &mut other.x; | ^^^^^^^ cannot mutably borrow immutable field -error: cannot borrow immutable field `z.x` as mutable +error[E0596]: cannot borrow immutable field `z.x` as mutable --> $DIR/issue-39544.rs:51:18 | 50 | pub fn with_arg(z: Z, w: &Z) { @@ -81,7 +81,7 @@ error: cannot borrow immutable field `z.x` as mutable 51 | let _ = &mut z.x; | ^^^ cannot mutably borrow immutable field -error: cannot borrow immutable field `w.x` as mutable +error[E0596]: cannot borrow immutable field `w.x` as mutable --> $DIR/issue-39544.rs:52:18 | 50 | pub fn with_arg(z: Z, w: &Z) { @@ -90,7 +90,7 @@ error: cannot borrow immutable field `w.x` as mutable 52 | let _ = &mut w.x; | ^^^ cannot mutably borrow immutable field -error: cannot assign to immutable borrowed content `*x.0` +error[E0594]: cannot assign to immutable borrowed content `*x.0` --> $DIR/issue-39544.rs:58:5 | 58 | *x.0 = 1; diff --git a/src/test/ui/did_you_mean/issue-40823.stderr b/src/test/ui/did_you_mean/issue-40823.stderr index 5718471527d88..a034ea809692a 100644 --- a/src/test/ui/did_you_mean/issue-40823.stderr +++ b/src/test/ui/did_you_mean/issue-40823.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable borrowed content `*buf` as mutable +error[E0596]: cannot borrow immutable borrowed content `*buf` as mutable --> $DIR/issue-40823.rs:13:5 | 13 | buf.iter_mut(); diff --git a/src/test/ui/dropck/dropck-eyepatch-extern-crate.stderr b/src/test/ui/dropck/dropck-eyepatch-extern-crate.stderr index b69b4f9f32117..a5a3c48ab9752 100644 --- a/src/test/ui/dropck/dropck-eyepatch-extern-crate.stderr +++ b/src/test/ui/dropck/dropck-eyepatch-extern-crate.stderr @@ -1,4 +1,4 @@ -error: `c` does not live long enough +error[E0597]: `c` does not live long enough --> $DIR/dropck-eyepatch-extern-crate.rs:55:1 | 39 | dt = Dt("dt", &c); //~ ERROR `c` does not live long enough @@ -9,7 +9,7 @@ error: `c` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c` does not live long enough +error[E0597]: `c` does not live long enough --> $DIR/dropck-eyepatch-extern-crate.rs:55:1 | 40 | dr = Dr("dr", &c); //~ ERROR `c` does not live long enough @@ -20,7 +20,7 @@ error: `c` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c` does not live long enough +error[E0597]: `c` does not live long enough --> $DIR/dropck-eyepatch-extern-crate.rs:55:1 | 47 | pt = Pt("pt", &c_long, &c); //~ ERROR `c` does not live long enough @@ -31,7 +31,7 @@ error: `c` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c` does not live long enough +error[E0597]: `c` does not live long enough --> $DIR/dropck-eyepatch-extern-crate.rs:55:1 | 48 | pr = Pr("pr", &c_long, &c); //~ ERROR `c` does not live long enough diff --git a/src/test/ui/dropck/dropck-eyepatch-reorder.stderr b/src/test/ui/dropck/dropck-eyepatch-reorder.stderr index ddd213dd9ad70..de04a1c4283d1 100644 --- a/src/test/ui/dropck/dropck-eyepatch-reorder.stderr +++ b/src/test/ui/dropck/dropck-eyepatch-reorder.stderr @@ -1,4 +1,4 @@ -error: `c` does not live long enough +error[E0597]: `c` does not live long enough --> $DIR/dropck-eyepatch-reorder.rs:73:1 | 57 | dt = Dt("dt", &c); //~ ERROR `c` does not live long enough @@ -9,7 +9,7 @@ error: `c` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c` does not live long enough +error[E0597]: `c` does not live long enough --> $DIR/dropck-eyepatch-reorder.rs:73:1 | 58 | dr = Dr("dr", &c); //~ ERROR `c` does not live long enough @@ -20,7 +20,7 @@ error: `c` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c` does not live long enough +error[E0597]: `c` does not live long enough --> $DIR/dropck-eyepatch-reorder.rs:73:1 | 65 | pt = Pt("pt", &c_long, &c); //~ ERROR `c` does not live long enough @@ -31,7 +31,7 @@ error: `c` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c` does not live long enough +error[E0597]: `c` does not live long enough --> $DIR/dropck-eyepatch-reorder.rs:73:1 | 66 | pr = Pr("pr", &c_long, &c); //~ ERROR `c` does not live long enough diff --git a/src/test/ui/dropck/dropck-eyepatch.stderr b/src/test/ui/dropck/dropck-eyepatch.stderr index d9d00919b6dca..26fee852fb24a 100644 --- a/src/test/ui/dropck/dropck-eyepatch.stderr +++ b/src/test/ui/dropck/dropck-eyepatch.stderr @@ -1,4 +1,4 @@ -error: `c` does not live long enough +error[E0597]: `c` does not live long enough --> $DIR/dropck-eyepatch.rs:96:1 | 80 | dt = Dt("dt", &c); //~ ERROR `c` does not live long enough @@ -9,7 +9,7 @@ error: `c` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c` does not live long enough +error[E0597]: `c` does not live long enough --> $DIR/dropck-eyepatch.rs:96:1 | 81 | dr = Dr("dr", &c); //~ ERROR `c` does not live long enough @@ -20,7 +20,7 @@ error: `c` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c` does not live long enough +error[E0597]: `c` does not live long enough --> $DIR/dropck-eyepatch.rs:96:1 | 88 | pt = Pt("pt", &c_long, &c); //~ ERROR `c` does not live long enough @@ -31,7 +31,7 @@ error: `c` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c` does not live long enough +error[E0597]: `c` does not live long enough --> $DIR/dropck-eyepatch.rs:96:1 | 89 | pr = Pr("pr", &c_long, &c); //~ ERROR `c` does not live long enough diff --git a/src/test/ui/issue-41652/issue_41652.stderr b/src/test/ui/issue-41652/issue_41652.stderr index a0177e79ac467..4625e9269c995 100644 --- a/src/test/ui/issue-41652/issue_41652.stderr +++ b/src/test/ui/issue-41652/issue_41652.stderr @@ -1,4 +1,4 @@ -error: no method named `f` found for type `{integer}` in the current scope +error[E0599]: no method named `f` found for type `{integer}` in the current scope --> $DIR/issue_41652.rs:19:11 | 19 | 3.f() diff --git a/src/test/ui/lifetimes/borrowck-let-suggestion.stderr b/src/test/ui/lifetimes/borrowck-let-suggestion.stderr index 768057301d126..2bc0acd626c07 100644 --- a/src/test/ui/lifetimes/borrowck-let-suggestion.stderr +++ b/src/test/ui/lifetimes/borrowck-let-suggestion.stderr @@ -1,4 +1,4 @@ -error: borrowed value does not live long enough +error[E0597]: borrowed value does not live long enough --> $DIR/borrowck-let-suggestion.rs:12:23 | 12 | let x = [1].iter(); diff --git a/src/test/ui/macros/macro-backtrace-invalid-internals.stderr b/src/test/ui/macros/macro-backtrace-invalid-internals.stderr index 304d4459e4975..2c83a84f0040f 100644 --- a/src/test/ui/macros/macro-backtrace-invalid-internals.stderr +++ b/src/test/ui/macros/macro-backtrace-invalid-internals.stderr @@ -1,4 +1,4 @@ -error: no method named `fake` found for type `{integer}` in the current scope +error[E0599]: no method named `fake` found for type `{integer}` in the current scope --> $DIR/macro-backtrace-invalid-internals.rs:15:13 | 15 | 1.fake() @@ -25,7 +25,7 @@ error: attempted tuple index `0` on type `{integer}`, but the type was not a tup 52 | fake_anon_field_stmt!(); | ------------------------ in this macro invocation -error: no method named `fake` found for type `{integer}` in the current scope +error[E0599]: no method named `fake` found for type `{integer}` in the current scope --> $DIR/macro-backtrace-invalid-internals.rs:33:13 | 33 | 1.fake() diff --git a/src/test/ui/mismatched_types/issue-36053-2.stderr b/src/test/ui/mismatched_types/issue-36053-2.stderr index d72ab326ce644..8b756814ced80 100644 --- a/src/test/ui/mismatched_types/issue-36053-2.stderr +++ b/src/test/ui/mismatched_types/issue-36053-2.stderr @@ -1,4 +1,4 @@ -error: no method named `count` found for type `std::iter::Filter>, [closure@$DIR/issue-36053-2.rs:17:39: 17:53]>` in the current scope +error[E0599]: no method named `count` found for type `std::iter::Filter>, [closure@$DIR/issue-36053-2.rs:17:39: 17:53]>` in the current scope --> $DIR/issue-36053-2.rs:17:55 | 17 | once::<&str>("str").fuse().filter(|a: &str| true).count(); diff --git a/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr b/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr index c7a52fea3bc8c..80f95da0bbe44 100644 --- a/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr +++ b/src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr @@ -1,4 +1,4 @@ -error: no method named `unwrap` found for type `std::result::Result<(), Foo>` in the current scope +error[E0599]: no method named `unwrap` found for type `std::result::Result<(), Foo>` in the current scope --> $DIR/method-help-unsatisfied-bound.rs:15:7 | 15 | a.unwrap(); diff --git a/src/test/ui/reachable/expr_unary.stderr b/src/test/ui/reachable/expr_unary.stderr index 889e3e01c6daa..f47791455afed 100644 --- a/src/test/ui/reachable/expr_unary.stderr +++ b/src/test/ui/reachable/expr_unary.stderr @@ -1,4 +1,4 @@ -error: cannot apply unary operator `!` to type `!` +error[E0600]: cannot apply unary operator `!` to type `!` --> $DIR/expr_unary.rs:18:16 | 18 | let x: ! = ! { return; 22 }; diff --git a/src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr b/src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr index 7cd9f30f42c17..4b01f5bea7cf2 100644 --- a/src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr +++ b/src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable argument `x` as mutable +error[E0596]: cannot borrow immutable argument `x` as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:63:24 | 62 | fn deref_mut_field1(x: Own) { @@ -6,7 +6,7 @@ error: cannot borrow immutable argument `x` as mutable 63 | let __isize = &mut x.y; //~ ERROR cannot borrow | ^ cannot borrow mutably -error: cannot borrow immutable borrowed content `*x` as mutable +error[E0596]: cannot borrow immutable borrowed content `*x` as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:75:10 | 74 | fn deref_extend_mut_field1(x: &Own) -> &mut isize { @@ -24,7 +24,7 @@ error[E0499]: cannot borrow `*x` as mutable more than once at a time 89 | } | - first borrow ends here -error: cannot borrow immutable argument `x` as mutable +error[E0596]: cannot borrow immutable argument `x` as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:98:5 | 97 | fn assign_field1<'a>(x: Own) { @@ -32,7 +32,7 @@ error: cannot borrow immutable argument `x` as mutable 98 | x.y = 3; //~ ERROR cannot borrow | ^ cannot borrow mutably -error: cannot borrow immutable borrowed content `*x` as mutable +error[E0596]: cannot borrow immutable borrowed content `*x` as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:102:5 | 101 | fn assign_field2<'a>(x: &'a Own) { @@ -50,7 +50,7 @@ error[E0499]: cannot borrow `*x` as mutable more than once at a time 112 | } | - first borrow ends here -error: cannot borrow immutable argument `x` as mutable +error[E0596]: cannot borrow immutable argument `x` as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:119:5 | 118 | fn deref_mut_method1(x: Own) { @@ -58,7 +58,7 @@ error: cannot borrow immutable argument `x` as mutable 119 | x.set(0, 0); //~ ERROR cannot borrow | ^ cannot borrow mutably -error: cannot borrow immutable borrowed content `*x` as mutable +error[E0596]: cannot borrow immutable borrowed content `*x` as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:131:5 | 130 | fn deref_extend_mut_method1(x: &Own) -> &mut isize { @@ -66,7 +66,7 @@ error: cannot borrow immutable borrowed content `*x` as mutable 131 | x.y_mut() //~ ERROR cannot borrow | ^ cannot borrow as mutable -error: cannot borrow immutable argument `x` as mutable +error[E0596]: cannot borrow immutable argument `x` as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:139:6 | 138 | fn assign_method1<'a>(x: Own) { @@ -74,7 +74,7 @@ error: cannot borrow immutable argument `x` as mutable 139 | *x.y_mut() = 3; //~ ERROR cannot borrow | ^ cannot borrow mutably -error: cannot borrow immutable borrowed content `*x` as mutable +error[E0596]: cannot borrow immutable borrowed content `*x` as mutable --> $DIR/borrowck-borrow-overloaded-auto-deref-mut.rs:143:6 | 142 | fn assign_method2<'a>(x: &'a Own) { diff --git a/src/test/ui/span/borrowck-borrow-overloaded-deref-mut.stderr b/src/test/ui/span/borrowck-borrow-overloaded-deref-mut.stderr index 83c49409049d8..886cc14203956 100644 --- a/src/test/ui/span/borrowck-borrow-overloaded-deref-mut.stderr +++ b/src/test/ui/span/borrowck-borrow-overloaded-deref-mut.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable argument `x` as mutable +error[E0596]: cannot borrow immutable argument `x` as mutable --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:39:25 | 38 | fn deref_mut1(x: Own) { @@ -6,7 +6,7 @@ error: cannot borrow immutable argument `x` as mutable 39 | let __isize = &mut *x; //~ ERROR cannot borrow | ^ cannot borrow mutably -error: cannot borrow immutable borrowed content `*x` as mutable +error[E0596]: cannot borrow immutable borrowed content `*x` as mutable --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:51:11 | 50 | fn deref_extend_mut1<'a>(x: &'a Own) -> &'a mut isize { @@ -14,7 +14,7 @@ error: cannot borrow immutable borrowed content `*x` as mutable 51 | &mut **x //~ ERROR cannot borrow | ^^ cannot borrow as mutable -error: cannot borrow immutable argument `x` as mutable +error[E0596]: cannot borrow immutable argument `x` as mutable --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:59:6 | 58 | fn assign1<'a>(x: Own) { @@ -22,7 +22,7 @@ error: cannot borrow immutable argument `x` as mutable 59 | *x = 3; //~ ERROR cannot borrow | ^ cannot borrow mutably -error: cannot borrow immutable borrowed content `*x` as mutable +error[E0596]: cannot borrow immutable borrowed content `*x` as mutable --> $DIR/borrowck-borrow-overloaded-deref-mut.rs:63:6 | 62 | fn assign2<'a>(x: &'a Own) { diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr index bfb51ba481662..a26ca490dd5ee 100644 --- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr +++ b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr @@ -11,7 +11,7 @@ error[E0499]: cannot borrow `f` as mutable more than once at a time 27 | })); | - first borrow ends here -error: cannot borrow immutable borrowed content `*f` as mutable +error[E0596]: cannot borrow immutable borrowed content `*f` as mutable --> $DIR/borrowck-call-is-borrow-issue-12224.rs:39:5 | 37 | fn test2(f: &F) where F: FnMut() { @@ -20,7 +20,7 @@ error: cannot borrow immutable borrowed content `*f` as mutable 39 | (*f)(); | ^^^^ cannot borrow as mutable -error: cannot borrow immutable `Box` content `*f.f` as mutable +error[E0596]: cannot borrow immutable `Box` content `*f.f` as mutable --> $DIR/borrowck-call-is-borrow-issue-12224.rs:50:5 | 48 | fn test4(f: &Test) { diff --git a/src/test/ui/span/borrowck-call-method-from-mut-aliasable.stderr b/src/test/ui/span/borrowck-call-method-from-mut-aliasable.stderr index 00fa6577545da..dea95d6bf6dca 100644 --- a/src/test/ui/span/borrowck-call-method-from-mut-aliasable.stderr +++ b/src/test/ui/span/borrowck-call-method-from-mut-aliasable.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable borrowed content `*x` as mutable +error[E0596]: cannot borrow immutable borrowed content `*x` as mutable --> $DIR/borrowck-call-method-from-mut-aliasable.rs:27:5 | 25 | fn b(x: &Foo) { diff --git a/src/test/ui/span/borrowck-fn-in-const-b.stderr b/src/test/ui/span/borrowck-fn-in-const-b.stderr index 75866b7e45e31..3bf56881c54ae 100644 --- a/src/test/ui/span/borrowck-fn-in-const-b.stderr +++ b/src/test/ui/span/borrowck-fn-in-const-b.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable borrowed content `*x` as mutable +error[E0596]: cannot borrow immutable borrowed content `*x` as mutable --> $DIR/borrowck-fn-in-const-b.rs:17:9 | 16 | fn broken(x: &Vec) { diff --git a/src/test/ui/span/borrowck-let-suggestion-suffixes.stderr b/src/test/ui/span/borrowck-let-suggestion-suffixes.stderr index fd2a752c4721b..04dbcd2ef499f 100644 --- a/src/test/ui/span/borrowck-let-suggestion-suffixes.stderr +++ b/src/test/ui/span/borrowck-let-suggestion-suffixes.stderr @@ -1,4 +1,4 @@ -error: `young[..]` does not live long enough +error[E0597]: `young[..]` does not live long enough --> $DIR/borrowck-let-suggestion-suffixes.rs:52:1 | 19 | v2.push(&young[0]); // statement 4 @@ -9,7 +9,7 @@ error: `young[..]` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: borrowed value does not live long enough +error[E0597]: borrowed value does not live long enough --> $DIR/borrowck-let-suggestion-suffixes.rs:24:18 | 24 | v3.push(&'x'); // statement 6 @@ -22,7 +22,7 @@ error: borrowed value does not live long enough | = note: consider using a `let` binding to increase its lifetime -error: borrowed value does not live long enough +error[E0597]: borrowed value does not live long enough --> $DIR/borrowck-let-suggestion-suffixes.rs:34:22 | 34 | v4.push(&'y'); @@ -35,7 +35,7 @@ error: borrowed value does not live long enough | = note: consider using a `let` binding to increase its lifetime -error: borrowed value does not live long enough +error[E0597]: borrowed value does not live long enough --> $DIR/borrowck-let-suggestion-suffixes.rs:45:18 | 45 | v5.push(&'z'); diff --git a/src/test/ui/span/borrowck-object-mutability.stderr b/src/test/ui/span/borrowck-object-mutability.stderr index 86316d8980d0c..877b17dc27dff 100644 --- a/src/test/ui/span/borrowck-object-mutability.stderr +++ b/src/test/ui/span/borrowck-object-mutability.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable borrowed content `*x` as mutable +error[E0596]: cannot borrow immutable borrowed content `*x` as mutable --> $DIR/borrowck-object-mutability.rs:19:5 | 17 | fn borrowed_receiver(x: &Foo) { @@ -7,7 +7,7 @@ error: cannot borrow immutable borrowed content `*x` as mutable 19 | x.borrowed_mut(); //~ ERROR cannot borrow | ^ cannot borrow as mutable -error: cannot borrow immutable `Box` content `*x` as mutable +error[E0596]: cannot borrow immutable `Box` content `*x` as mutable --> $DIR/borrowck-object-mutability.rs:29:5 | 27 | fn owned_receiver(x: Box) { diff --git a/src/test/ui/span/borrowck-ref-into-rvalue.stderr b/src/test/ui/span/borrowck-ref-into-rvalue.stderr index 38ce3d398baaf..e0a484bcb37ad 100644 --- a/src/test/ui/span/borrowck-ref-into-rvalue.stderr +++ b/src/test/ui/span/borrowck-ref-into-rvalue.stderr @@ -1,4 +1,4 @@ -error: borrowed value does not live long enough +error[E0597]: borrowed value does not live long enough --> $DIR/borrowck-ref-into-rvalue.rs:18:5 | 14 | Some(ref m) => { //~ ERROR borrowed value does not live long enough diff --git a/src/test/ui/span/destructor-restrictions.stderr b/src/test/ui/span/destructor-restrictions.stderr index bf449518ce70c..1472a364863de 100644 --- a/src/test/ui/span/destructor-restrictions.stderr +++ b/src/test/ui/span/destructor-restrictions.stderr @@ -1,4 +1,4 @@ -error: `*a` does not live long enough +error[E0597]: `*a` does not live long enough --> $DIR/destructor-restrictions.rs:19:5 | 18 | *a.borrow() + 1 //~ ERROR `*a` does not live long enough diff --git a/src/test/ui/span/dropck-object-cycle.stderr b/src/test/ui/span/dropck-object-cycle.stderr index f098448527905..d0fceb2a03eef 100644 --- a/src/test/ui/span/dropck-object-cycle.stderr +++ b/src/test/ui/span/dropck-object-cycle.stderr @@ -1,4 +1,4 @@ -error: `*m` does not live long enough +error[E0597]: `*m` does not live long enough --> $DIR/dropck-object-cycle.rs:57:1 | 37 | assert_eq!(object_invoke1(&*m), (4,5)); diff --git a/src/test/ui/span/dropck_arr_cycle_checked.stderr b/src/test/ui/span/dropck_arr_cycle_checked.stderr index ea5163cf92472..2a9c2c8413f57 100644 --- a/src/test/ui/span/dropck_arr_cycle_checked.stderr +++ b/src/test/ui/span/dropck_arr_cycle_checked.stderr @@ -1,4 +1,4 @@ -error: `b2` does not live long enough +error[E0597]: `b2` does not live long enough --> $DIR/dropck_arr_cycle_checked.rs:109:1 | 103 | b1.a[0].v.set(Some(&b2)); @@ -9,7 +9,7 @@ error: `b2` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `b3` does not live long enough +error[E0597]: `b3` does not live long enough --> $DIR/dropck_arr_cycle_checked.rs:109:1 | 104 | b1.a[1].v.set(Some(&b3)); @@ -20,7 +20,7 @@ error: `b3` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `b2` does not live long enough +error[E0597]: `b2` does not live long enough --> $DIR/dropck_arr_cycle_checked.rs:109:1 | 105 | b2.a[0].v.set(Some(&b2)); @@ -31,7 +31,7 @@ error: `b2` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `b3` does not live long enough +error[E0597]: `b3` does not live long enough --> $DIR/dropck_arr_cycle_checked.rs:109:1 | 106 | b2.a[1].v.set(Some(&b3)); @@ -42,7 +42,7 @@ error: `b3` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `b1` does not live long enough +error[E0597]: `b1` does not live long enough --> $DIR/dropck_arr_cycle_checked.rs:109:1 | 107 | b3.a[0].v.set(Some(&b1)); @@ -53,7 +53,7 @@ error: `b1` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `b2` does not live long enough +error[E0597]: `b2` does not live long enough --> $DIR/dropck_arr_cycle_checked.rs:109:1 | 108 | b3.a[1].v.set(Some(&b2)); diff --git a/src/test/ui/span/dropck_direct_cycle_with_drop.stderr b/src/test/ui/span/dropck_direct_cycle_with_drop.stderr index d5f22a2665049..e6421cd47854e 100644 --- a/src/test/ui/span/dropck_direct_cycle_with_drop.stderr +++ b/src/test/ui/span/dropck_direct_cycle_with_drop.stderr @@ -1,4 +1,4 @@ -error: `d2` does not live long enough +error[E0597]: `d2` does not live long enough --> $DIR/dropck_direct_cycle_with_drop.rs:48:1 | 46 | d1.p.set(Some(&d2)); @@ -9,7 +9,7 @@ error: `d2` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `d1` does not live long enough +error[E0597]: `d1` does not live long enough --> $DIR/dropck_direct_cycle_with_drop.rs:48:1 | 47 | d2.p.set(Some(&d1)); diff --git a/src/test/ui/span/dropck_misc_variants.stderr b/src/test/ui/span/dropck_misc_variants.stderr index 4ad98b429c53b..7fbdcba7eb688 100644 --- a/src/test/ui/span/dropck_misc_variants.stderr +++ b/src/test/ui/span/dropck_misc_variants.stderr @@ -1,4 +1,4 @@ -error: `bomb` does not live long enough +error[E0597]: `bomb` does not live long enough --> $DIR/dropck_misc_variants.rs:34:1 | 33 | _w = Wrap::<&[&str]>(NoisyDrop(&bomb)); @@ -8,7 +8,7 @@ error: `bomb` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `v` does not live long enough +error[E0597]: `v` does not live long enough --> $DIR/dropck_misc_variants.rs:44:1 | 41 | let u = NoisyDrop(&v); diff --git a/src/test/ui/span/dropck_vec_cycle_checked.stderr b/src/test/ui/span/dropck_vec_cycle_checked.stderr index e38c49d6a5c36..3861b145c1b5f 100644 --- a/src/test/ui/span/dropck_vec_cycle_checked.stderr +++ b/src/test/ui/span/dropck_vec_cycle_checked.stderr @@ -1,4 +1,4 @@ -error: `c2` does not live long enough +error[E0597]: `c2` does not live long enough --> $DIR/dropck_vec_cycle_checked.rs:116:1 | 110 | c1.v[0].v.set(Some(&c2)); @@ -9,7 +9,7 @@ error: `c2` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c3` does not live long enough +error[E0597]: `c3` does not live long enough --> $DIR/dropck_vec_cycle_checked.rs:116:1 | 111 | c1.v[1].v.set(Some(&c3)); @@ -20,7 +20,7 @@ error: `c3` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c2` does not live long enough +error[E0597]: `c2` does not live long enough --> $DIR/dropck_vec_cycle_checked.rs:116:1 | 112 | c2.v[0].v.set(Some(&c2)); @@ -31,7 +31,7 @@ error: `c2` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c3` does not live long enough +error[E0597]: `c3` does not live long enough --> $DIR/dropck_vec_cycle_checked.rs:116:1 | 113 | c2.v[1].v.set(Some(&c3)); @@ -42,7 +42,7 @@ error: `c3` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c1` does not live long enough +error[E0597]: `c1` does not live long enough --> $DIR/dropck_vec_cycle_checked.rs:116:1 | 114 | c3.v[0].v.set(Some(&c1)); @@ -53,7 +53,7 @@ error: `c1` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c2` does not live long enough +error[E0597]: `c2` does not live long enough --> $DIR/dropck_vec_cycle_checked.rs:116:1 | 115 | c3.v[1].v.set(Some(&c2)); diff --git a/src/test/ui/span/issue-11925.stderr b/src/test/ui/span/issue-11925.stderr index 18cbf93323019..67d60fe085ad2 100644 --- a/src/test/ui/span/issue-11925.stderr +++ b/src/test/ui/span/issue-11925.stderr @@ -1,4 +1,4 @@ -error: `x` does not live long enough +error[E0597]: `x` does not live long enough --> $DIR/issue-11925.rs:18:36 | 18 | let f = to_fn_once(move|| &x); diff --git a/src/test/ui/span/issue-15480.stderr b/src/test/ui/span/issue-15480.stderr index d2534388f7255..f5f987c823f73 100644 --- a/src/test/ui/span/issue-15480.stderr +++ b/src/test/ui/span/issue-15480.stderr @@ -1,4 +1,4 @@ -error: borrowed value does not live long enough +error[E0597]: borrowed value does not live long enough --> $DIR/issue-15480.rs:14:6 | 13 | &3 diff --git a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr index bf7c099187ee6..e564b7ccef235 100644 --- a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr +++ b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr @@ -1,4 +1,4 @@ -error: `y` does not live long enough +error[E0597]: `y` does not live long enough --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:21:1 | 20 | y.borrow().clone() @@ -8,7 +8,7 @@ error: `y` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `y` does not live long enough +error[E0597]: `y` does not live long enough --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:28:5 | 27 | y.borrow().clone() //~ ERROR `y` does not live long enough diff --git a/src/test/ui/span/issue-24805-dropck-child-has-items-via-parent.stderr b/src/test/ui/span/issue-24805-dropck-child-has-items-via-parent.stderr index 8c2254483e030..314ef0ecbbcd3 100644 --- a/src/test/ui/span/issue-24805-dropck-child-has-items-via-parent.stderr +++ b/src/test/ui/span/issue-24805-dropck-child-has-items-via-parent.stderr @@ -1,4 +1,4 @@ -error: `d1` does not live long enough +error[E0597]: `d1` does not live long enough --> $DIR/issue-24805-dropck-child-has-items-via-parent.rs:42:1 | 38 | _d = D_Child(&d1); diff --git a/src/test/ui/span/issue-24805-dropck-trait-has-items.stderr b/src/test/ui/span/issue-24805-dropck-trait-has-items.stderr index 450bc123e60bc..66f22d14578bb 100644 --- a/src/test/ui/span/issue-24805-dropck-trait-has-items.stderr +++ b/src/test/ui/span/issue-24805-dropck-trait-has-items.stderr @@ -1,4 +1,4 @@ -error: `d1` does not live long enough +error[E0597]: `d1` does not live long enough --> $DIR/issue-24805-dropck-trait-has-items.rs:48:1 | 47 | _d = D_HasSelfMethod(&d1); @@ -8,7 +8,7 @@ error: `d1` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `d1` does not live long enough +error[E0597]: `d1` does not live long enough --> $DIR/issue-24805-dropck-trait-has-items.rs:54:1 | 53 | _d = D_HasMethodWithSelfArg(&d1); @@ -18,7 +18,7 @@ error: `d1` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `d1` does not live long enough +error[E0597]: `d1` does not live long enough --> $DIR/issue-24805-dropck-trait-has-items.rs:60:1 | 59 | _d = D_HasType(&d1); diff --git a/src/test/ui/span/issue-24895-copy-clone-dropck.stderr b/src/test/ui/span/issue-24895-copy-clone-dropck.stderr index dfee66ae546cd..cfa8359088a9f 100644 --- a/src/test/ui/span/issue-24895-copy-clone-dropck.stderr +++ b/src/test/ui/span/issue-24895-copy-clone-dropck.stderr @@ -1,4 +1,4 @@ -error: `d1` does not live long enough +error[E0597]: `d1` does not live long enough --> $DIR/issue-24895-copy-clone-dropck.rs:38:1 | 37 | d2 = D(S(&d1, "inner"), "d2"); diff --git a/src/test/ui/span/issue-25199.stderr b/src/test/ui/span/issue-25199.stderr index 17c0555729753..999871db0939b 100644 --- a/src/test/ui/span/issue-25199.stderr +++ b/src/test/ui/span/issue-25199.stderr @@ -1,4 +1,4 @@ -error: `container` does not live long enough +error[E0597]: `container` does not live long enough --> $DIR/issue-25199.rs:83:1 | 80 | let test = Test{test: &container}; @@ -9,7 +9,7 @@ error: `container` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `container` does not live long enough +error[E0597]: `container` does not live long enough --> $DIR/issue-25199.rs:83:1 | 82 | container.store(test); diff --git a/src/test/ui/span/issue-26656.stderr b/src/test/ui/span/issue-26656.stderr index 1f5c64986c736..b4f0195f6a8bc 100644 --- a/src/test/ui/span/issue-26656.stderr +++ b/src/test/ui/span/issue-26656.stderr @@ -1,4 +1,4 @@ -error: `ticking` does not live long enough +error[E0597]: `ticking` does not live long enough --> $DIR/issue-26656.rs:51:1 | 50 | zook.button = B::BigRedButton(&ticking); diff --git a/src/test/ui/span/issue-29106.stderr b/src/test/ui/span/issue-29106.stderr index 2a7e59f0422e6..b645cbf402d95 100644 --- a/src/test/ui/span/issue-29106.stderr +++ b/src/test/ui/span/issue-29106.stderr @@ -1,4 +1,4 @@ -error: `x` does not live long enough +error[E0597]: `x` does not live long enough --> $DIR/issue-29106.rs:27:5 | 26 | y = Arc::new(Foo(&x)); @@ -8,7 +8,7 @@ error: `x` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `x` does not live long enough +error[E0597]: `x` does not live long enough --> $DIR/issue-29106.rs:33:5 | 32 | y = Rc::new(Foo(&x)); diff --git a/src/test/ui/span/issue-36537.stderr b/src/test/ui/span/issue-36537.stderr index dbce171dd9b7e..df06cd1d0ea0c 100644 --- a/src/test/ui/span/issue-36537.stderr +++ b/src/test/ui/span/issue-36537.stderr @@ -1,4 +1,4 @@ -error: `a` does not live long enough +error[E0597]: `a` does not live long enough --> $DIR/issue-36537.rs:15:1 | 14 | p = &a; //~ NOTE borrow occurs here diff --git a/src/test/ui/span/issue-40157.stderr b/src/test/ui/span/issue-40157.stderr index 160f65fd1b9af..50183aa3bde81 100644 --- a/src/test/ui/span/issue-40157.stderr +++ b/src/test/ui/span/issue-40157.stderr @@ -1,4 +1,4 @@ -error: `foo` does not live long enough +error[E0597]: `foo` does not live long enough --> $DIR/issue-40157.rs:12:64 | 12 | {println!("{:?}", match { let foo = vec![1, 2]; foo.get(1) } { x => x });} diff --git a/src/test/ui/span/issue-7575.stderr b/src/test/ui/span/issue-7575.stderr index c017e38680826..9f368f0de9661 100644 --- a/src/test/ui/span/issue-7575.stderr +++ b/src/test/ui/span/issue-7575.stderr @@ -1,4 +1,4 @@ -error: no method named `f9` found for type `usize` in the current scope +error[E0599]: no method named `f9` found for type `usize` in the current scope --> $DIR/issue-7575.rs:74:18 | 74 | u.f8(42) + u.f9(342) + m.fff(42) @@ -28,7 +28,7 @@ note: candidate #3 is defined in the trait `UnusedTrait` = help: candidate #2: `OtherTrait` = help: candidate #3: `UnusedTrait` -error: no method named `fff` found for type `Myisize` in the current scope +error[E0599]: no method named `fff` found for type `Myisize` in the current scope --> $DIR/issue-7575.rs:74:30 | 74 | u.f8(42) + u.f9(342) + m.fff(42) @@ -43,7 +43,7 @@ note: candidate #1 is defined in an impl for the type `Myisize` 53 | | } | |_____^ -error: no method named `is_str` found for type `T` in the current scope +error[E0599]: no method named `is_str` found for type `T` in the current scope --> $DIR/issue-7575.rs:85:7 | 85 | t.is_str() diff --git a/src/test/ui/span/issue28498-reject-ex1.stderr b/src/test/ui/span/issue28498-reject-ex1.stderr index 06b7f922b684c..a2ef99f9d76ff 100644 --- a/src/test/ui/span/issue28498-reject-ex1.stderr +++ b/src/test/ui/span/issue28498-reject-ex1.stderr @@ -1,4 +1,4 @@ -error: `foo.data` does not live long enough +error[E0597]: `foo.data` does not live long enough --> $DIR/issue28498-reject-ex1.rs:46:1 | 44 | foo.data[0].1.set(Some(&foo.data[1])); @@ -9,7 +9,7 @@ error: `foo.data` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `foo.data` does not live long enough +error[E0597]: `foo.data` does not live long enough --> $DIR/issue28498-reject-ex1.rs:46:1 | 45 | foo.data[1].1.set(Some(&foo.data[0])); diff --git a/src/test/ui/span/issue28498-reject-lifetime-param.stderr b/src/test/ui/span/issue28498-reject-lifetime-param.stderr index d166af522478e..cb77cd3dc991c 100644 --- a/src/test/ui/span/issue28498-reject-lifetime-param.stderr +++ b/src/test/ui/span/issue28498-reject-lifetime-param.stderr @@ -1,4 +1,4 @@ -error: `last_dropped` does not live long enough +error[E0597]: `last_dropped` does not live long enough --> $DIR/issue28498-reject-lifetime-param.rs:46:1 | 42 | foo0 = Foo(0, &last_dropped); @@ -9,7 +9,7 @@ error: `last_dropped` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `first_dropped` does not live long enough +error[E0597]: `first_dropped` does not live long enough --> $DIR/issue28498-reject-lifetime-param.rs:46:1 | 43 | foo1 = Foo(1, &first_dropped); diff --git a/src/test/ui/span/issue28498-reject-passed-to-fn.stderr b/src/test/ui/span/issue28498-reject-passed-to-fn.stderr index 6a02d7015733d..49116c340ec5c 100644 --- a/src/test/ui/span/issue28498-reject-passed-to-fn.stderr +++ b/src/test/ui/span/issue28498-reject-passed-to-fn.stderr @@ -1,4 +1,4 @@ -error: `last_dropped` does not live long enough +error[E0597]: `last_dropped` does not live long enough --> $DIR/issue28498-reject-passed-to-fn.rs:48:1 | 44 | foo0 = Foo(0, &last_dropped, Box::new(callback)); @@ -9,7 +9,7 @@ error: `last_dropped` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `first_dropped` does not live long enough +error[E0597]: `first_dropped` does not live long enough --> $DIR/issue28498-reject-passed-to-fn.rs:48:1 | 45 | foo1 = Foo(1, &first_dropped, Box::new(callback)); diff --git a/src/test/ui/span/issue28498-reject-trait-bound.stderr b/src/test/ui/span/issue28498-reject-trait-bound.stderr index 91a410e0f6589..bb4de82422ae8 100644 --- a/src/test/ui/span/issue28498-reject-trait-bound.stderr +++ b/src/test/ui/span/issue28498-reject-trait-bound.stderr @@ -1,4 +1,4 @@ -error: `last_dropped` does not live long enough +error[E0597]: `last_dropped` does not live long enough --> $DIR/issue28498-reject-trait-bound.rs:48:1 | 44 | foo0 = Foo(0, &last_dropped); @@ -9,7 +9,7 @@ error: `last_dropped` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `first_dropped` does not live long enough +error[E0597]: `first_dropped` does not live long enough --> $DIR/issue28498-reject-trait-bound.rs:48:1 | 45 | foo1 = Foo(1, &first_dropped); diff --git a/src/test/ui/span/loan-extend.stderr b/src/test/ui/span/loan-extend.stderr index 6095a3b6be5cb..036c4bd6b8d14 100644 --- a/src/test/ui/span/loan-extend.stderr +++ b/src/test/ui/span/loan-extend.stderr @@ -1,4 +1,4 @@ -error: `short` does not live long enough +error[E0597]: `short` does not live long enough --> $DIR/loan-extend.rs:21:1 | 19 | long = borrow(&mut short); diff --git a/src/test/ui/span/mut-arg-hint.stderr b/src/test/ui/span/mut-arg-hint.stderr index d5e6b62865586..754e96aa808a8 100644 --- a/src/test/ui/span/mut-arg-hint.stderr +++ b/src/test/ui/span/mut-arg-hint.stderr @@ -1,4 +1,4 @@ -error: cannot borrow immutable borrowed content `*a` as mutable +error[E0596]: cannot borrow immutable borrowed content `*a` as mutable --> $DIR/mut-arg-hint.rs:13:9 | 12 | fn foo(mut a: &String) { @@ -6,7 +6,7 @@ error: cannot borrow immutable borrowed content `*a` as mutable 13 | a.push_str("bar"); | ^ cannot borrow as mutable -error: cannot borrow immutable borrowed content `*a` as mutable +error[E0596]: cannot borrow immutable borrowed content `*a` as mutable --> $DIR/mut-arg-hint.rs:18:5 | 17 | pub fn foo<'a>(mut a: &'a String) { @@ -14,7 +14,7 @@ error: cannot borrow immutable borrowed content `*a` as mutable 18 | a.push_str("foo"); | ^ cannot borrow as mutable -error: cannot borrow immutable borrowed content `*a` as mutable +error[E0596]: cannot borrow immutable borrowed content `*a` as mutable --> $DIR/mut-arg-hint.rs:25:9 | 24 | pub fn foo(mut a: &String) { diff --git a/src/test/ui/span/mut-ptr-cant-outlive-ref.stderr b/src/test/ui/span/mut-ptr-cant-outlive-ref.stderr index 68dc87d0667e2..5bd6a786cfd4f 100644 --- a/src/test/ui/span/mut-ptr-cant-outlive-ref.stderr +++ b/src/test/ui/span/mut-ptr-cant-outlive-ref.stderr @@ -1,4 +1,4 @@ -error: `b` does not live long enough +error[E0597]: `b` does not live long enough --> $DIR/mut-ptr-cant-outlive-ref.rs:19:5 | 18 | p = &*b; //~ ERROR `b` does not live long enough diff --git a/src/test/ui/span/range-2.stderr b/src/test/ui/span/range-2.stderr index 4f638562bb801..465a663a7416c 100644 --- a/src/test/ui/span/range-2.stderr +++ b/src/test/ui/span/range-2.stderr @@ -1,4 +1,4 @@ -error: `a` does not live long enough +error[E0597]: `a` does not live long enough --> $DIR/range-2.rs:20:5 | 17 | &a..&b @@ -9,7 +9,7 @@ error: `a` does not live long enough 21 | } | - borrowed value needs to live until here -error: `b` does not live long enough +error[E0597]: `b` does not live long enough --> $DIR/range-2.rs:20:5 | 17 | &a..&b diff --git a/src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr b/src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr index 6c5007a570535..80dadd97a1793 100644 --- a/src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr +++ b/src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr @@ -1,4 +1,4 @@ -error: `c` does not live long enough +error[E0597]: `c` does not live long enough --> $DIR/regionck-unboxed-closure-lifetimes.rs:19:5 | 17 | let c_ref = &c; //~ ERROR `c` does not live long enough diff --git a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr index d6a460d83ab0f..25386cb30b185 100644 --- a/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr +++ b/src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr @@ -1,4 +1,4 @@ -error: borrowed value does not live long enough +error[E0597]: borrowed value does not live long enough --> $DIR/regions-close-over-borrowed-ref-in-obj.rs:22:5 | 20 | let ss: &isize = &1; diff --git a/src/test/ui/span/regions-close-over-type-parameter-2.stderr b/src/test/ui/span/regions-close-over-type-parameter-2.stderr index 099f6df27efc6..9b5383877a08a 100644 --- a/src/test/ui/span/regions-close-over-type-parameter-2.stderr +++ b/src/test/ui/span/regions-close-over-type-parameter-2.stderr @@ -1,4 +1,4 @@ -error: `tmp0` does not live long enough +error[E0597]: `tmp0` does not live long enough --> $DIR/regions-close-over-type-parameter-2.rs:35:5 | 33 | let tmp1 = &tmp0; //~ ERROR `tmp0` does not live long enough diff --git a/src/test/ui/span/regions-escape-loop-via-variable.stderr b/src/test/ui/span/regions-escape-loop-via-variable.stderr index 09178ce57e8be..9f8c91cb9cdbd 100644 --- a/src/test/ui/span/regions-escape-loop-via-variable.stderr +++ b/src/test/ui/span/regions-escape-loop-via-variable.stderr @@ -1,4 +1,4 @@ -error: `x` does not live long enough +error[E0597]: `x` does not live long enough --> $DIR/regions-escape-loop-via-variable.rs:22:5 | 21 | p = &x; //~ ERROR `x` does not live long enough diff --git a/src/test/ui/span/regions-escape-loop-via-vec.stderr b/src/test/ui/span/regions-escape-loop-via-vec.stderr index 006060f342a38..4f0e61f113380 100644 --- a/src/test/ui/span/regions-escape-loop-via-vec.stderr +++ b/src/test/ui/span/regions-escape-loop-via-vec.stderr @@ -1,4 +1,4 @@ -error: `z` does not live long enough +error[E0597]: `z` does not live long enough --> $DIR/regions-escape-loop-via-vec.rs:26:5 | 22 | _y.push(&mut z); //~ ERROR `z` does not live long enough diff --git a/src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr b/src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr index d4dfef36e4afb..43103e619a549 100644 --- a/src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr +++ b/src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr @@ -1,4 +1,4 @@ -error: `*x` does not live long enough +error[E0597]: `*x` does not live long enough --> $DIR/regions-infer-borrow-scope-within-loop.rs:28:5 | 24 | y = borrow(&*x); //~ ERROR `*x` does not live long enough diff --git a/src/test/ui/span/send-is-not-static-ensures-scoping.stderr b/src/test/ui/span/send-is-not-static-ensures-scoping.stderr index 4a815a58b354d..b5e55adfb459e 100644 --- a/src/test/ui/span/send-is-not-static-ensures-scoping.stderr +++ b/src/test/ui/span/send-is-not-static-ensures-scoping.stderr @@ -1,4 +1,4 @@ -error: `x` does not live long enough +error[E0597]: `x` does not live long enough --> $DIR/send-is-not-static-ensures-scoping.rs:32:5 | 26 | let y = &x; //~ ERROR `x` does not live long enough @@ -10,7 +10,7 @@ error: `x` does not live long enough 35 | } | - borrowed value needs to live until here -error: `y` does not live long enough +error[E0597]: `y` does not live long enough --> $DIR/send-is-not-static-ensures-scoping.rs:29:22 | 28 | scoped(|| { diff --git a/src/test/ui/span/send-is-not-static-std-sync-2.stderr b/src/test/ui/span/send-is-not-static-std-sync-2.stderr index 815f88022675d..2845c4f6bda80 100644 --- a/src/test/ui/span/send-is-not-static-std-sync-2.stderr +++ b/src/test/ui/span/send-is-not-static-std-sync-2.stderr @@ -1,4 +1,4 @@ -error: `x` does not live long enough +error[E0597]: `x` does not live long enough --> $DIR/send-is-not-static-std-sync-2.rs:22:5 | 21 | Mutex::new(&x) //~ ERROR does not live long enough @@ -9,7 +9,7 @@ error: `x` does not live long enough 25 | } | - borrowed value needs to live until here -error: `x` does not live long enough +error[E0597]: `x` does not live long enough --> $DIR/send-is-not-static-std-sync-2.rs:31:5 | 30 | RwLock::new(&x) //~ ERROR does not live long enough @@ -20,7 +20,7 @@ error: `x` does not live long enough 33 | } | - borrowed value needs to live until here -error: `x` does not live long enough +error[E0597]: `x` does not live long enough --> $DIR/send-is-not-static-std-sync-2.rs:41:5 | 39 | let _ = tx.send(&x); //~ ERROR does not live long enough diff --git a/src/test/ui/span/send-is-not-static-std-sync.stderr b/src/test/ui/span/send-is-not-static-std-sync.stderr index 81f53c7f374eb..3d75a1b717aad 100644 --- a/src/test/ui/span/send-is-not-static-std-sync.stderr +++ b/src/test/ui/span/send-is-not-static-std-sync.stderr @@ -1,4 +1,4 @@ -error: `z` does not live long enough +error[E0597]: `z` does not live long enough --> $DIR/send-is-not-static-std-sync.rs:27:5 | 26 | *lock.lock().unwrap() = &z; //~ ERROR does not live long enough @@ -16,7 +16,7 @@ error[E0505]: cannot move out of `y` because it is borrowed 23 | drop(y); //~ ERROR cannot move out | ^ move out of `y` occurs here -error: `z` does not live long enough +error[E0597]: `z` does not live long enough --> $DIR/send-is-not-static-std-sync.rs:39:5 | 38 | *lock.write().unwrap() = &z; //~ ERROR does not live long enough @@ -34,7 +34,7 @@ error[E0505]: cannot move out of `y` because it is borrowed 35 | drop(y); //~ ERROR cannot move out | ^ move out of `y` occurs here -error: `z` does not live long enough +error[E0597]: `z` does not live long enough --> $DIR/send-is-not-static-std-sync.rs:53:5 | 52 | tx.send(&z).unwrap(); //~ ERROR does not live long enough diff --git a/src/test/ui/span/slice-borrow.stderr b/src/test/ui/span/slice-borrow.stderr index ff6d30d670de1..0c07d068d287e 100644 --- a/src/test/ui/span/slice-borrow.stderr +++ b/src/test/ui/span/slice-borrow.stderr @@ -1,4 +1,4 @@ -error: borrowed value does not live long enough +error[E0597]: borrowed value does not live long enough --> $DIR/slice-borrow.rs:18:5 | 16 | let x: &[isize] = &[1, 2, 3, 4, 5]; diff --git a/src/test/ui/span/vec-must-not-hide-type-from-dropck.stderr b/src/test/ui/span/vec-must-not-hide-type-from-dropck.stderr index fad46d5a7d052..0efbd8472aec4 100644 --- a/src/test/ui/span/vec-must-not-hide-type-from-dropck.stderr +++ b/src/test/ui/span/vec-must-not-hide-type-from-dropck.stderr @@ -1,4 +1,4 @@ -error: `c2` does not live long enough +error[E0597]: `c2` does not live long enough --> $DIR/vec-must-not-hide-type-from-dropck.rs:129:1 | 127 | c1.v[0].v.set(Some(&c2)); @@ -9,7 +9,7 @@ error: `c2` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `c1` does not live long enough +error[E0597]: `c1` does not live long enough --> $DIR/vec-must-not-hide-type-from-dropck.rs:129:1 | 128 | c2.v[0].v.set(Some(&c1)); diff --git a/src/test/ui/span/vec_refs_data_with_early_death.stderr b/src/test/ui/span/vec_refs_data_with_early_death.stderr index c890d4740e6c2..0dee15b42319f 100644 --- a/src/test/ui/span/vec_refs_data_with_early_death.stderr +++ b/src/test/ui/span/vec_refs_data_with_early_death.stderr @@ -1,4 +1,4 @@ -error: `x` does not live long enough +error[E0597]: `x` does not live long enough --> $DIR/vec_refs_data_with_early_death.rs:31:1 | 27 | v.push(&x); @@ -9,7 +9,7 @@ error: `x` does not live long enough | = note: values in a scope are dropped in the opposite order they are created -error: `y` does not live long enough +error[E0597]: `y` does not live long enough --> $DIR/vec_refs_data_with_early_death.rs:31:1 | 28 | v.push(&y); diff --git a/src/test/ui/span/wf-method-late-bound-regions.stderr b/src/test/ui/span/wf-method-late-bound-regions.stderr index ff1bf47d44d05..d5e663ff26d38 100644 --- a/src/test/ui/span/wf-method-late-bound-regions.stderr +++ b/src/test/ui/span/wf-method-late-bound-regions.stderr @@ -1,4 +1,4 @@ -error: `pointer` does not live long enough +error[E0597]: `pointer` does not live long enough --> $DIR/wf-method-late-bound-regions.rs:31:5 | 30 | f2.xmute(&pointer) //~ ERROR `pointer` does not live long enough diff --git a/src/test/ui/suggestions/confuse-field-and-method/issue-18343.stderr b/src/test/ui/suggestions/confuse-field-and-method/issue-18343.stderr index 0f2097dfb312c..b69d90cf8f78c 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/issue-18343.stderr +++ b/src/test/ui/suggestions/confuse-field-and-method/issue-18343.stderr @@ -1,4 +1,4 @@ -error: no method named `closure` found for type `Obj<[closure@$DIR/issue-18343.rs:16:28: 16:33]>` in the current scope +error[E0599]: no method named `closure` found for type `Obj<[closure@$DIR/issue-18343.rs:16:28: 16:33]>` in the current scope --> $DIR/issue-18343.rs:17:7 | 17 | o.closure(); diff --git a/src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr b/src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr index 0191060e837ba..218653239083b 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr +++ b/src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr @@ -1,4 +1,4 @@ -error: no method named `closure` found for type `Obj<[closure@$DIR/issue-2392.rs:49:36: 49:41]>` in the current scope +error[E0599]: no method named `closure` found for type `Obj<[closure@$DIR/issue-2392.rs:49:36: 49:41]>` in the current scope --> $DIR/issue-2392.rs:50:15 | 50 | o_closure.closure(); //~ ERROR no method named `closure` found @@ -6,7 +6,7 @@ error: no method named `closure` found for type `Obj<[closure@$DIR/issue-2392.rs | = help: use `(o_closure.closure)(...)` if you meant to call the function stored in the `closure` field -error: no method named `not_closure` found for type `Obj<[closure@$DIR/issue-2392.rs:49:36: 49:41]>` in the current scope +error[E0599]: no method named `not_closure` found for type `Obj<[closure@$DIR/issue-2392.rs:49:36: 49:41]>` in the current scope --> $DIR/issue-2392.rs:54:15 | 54 | o_closure.not_closure(); @@ -14,7 +14,7 @@ error: no method named `not_closure` found for type `Obj<[closure@$DIR/issue-239 | = help: did you mean to write `o_closure.not_closure` instead of `o_closure.not_closure(...)`? -error: no method named `closure` found for type `Obj u32 {func}>` in the current scope +error[E0599]: no method named `closure` found for type `Obj u32 {func}>` in the current scope --> $DIR/issue-2392.rs:60:12 | 60 | o_func.closure(); //~ ERROR no method named `closure` found @@ -22,7 +22,7 @@ error: no method named `closure` found for type `Obj u32 {func}>` in the | = help: use `(o_func.closure)(...)` if you meant to call the function stored in the `closure` field -error: no method named `boxed_closure` found for type `BoxedObj` in the current scope +error[E0599]: no method named `boxed_closure` found for type `BoxedObj` in the current scope --> $DIR/issue-2392.rs:65:14 | 65 | boxed_fn.boxed_closure();//~ ERROR no method named `boxed_closure` found @@ -30,7 +30,7 @@ error: no method named `boxed_closure` found for type `BoxedObj` in the current | = help: use `(boxed_fn.boxed_closure)(...)` if you meant to call the function stored in the `boxed_closure` field -error: no method named `boxed_closure` found for type `BoxedObj` in the current scope +error[E0599]: no method named `boxed_closure` found for type `BoxedObj` in the current scope --> $DIR/issue-2392.rs:70:19 | 70 | boxed_closure.boxed_closure();//~ ERROR no method named `boxed_closure` found @@ -38,7 +38,7 @@ error: no method named `boxed_closure` found for type `BoxedObj` in the current | = help: use `(boxed_closure.boxed_closure)(...)` if you meant to call the function stored in the `boxed_closure` field -error: no method named `closure` found for type `Obj u32 {func}>` in the current scope +error[E0599]: no method named `closure` found for type `Obj u32 {func}>` in the current scope --> $DIR/issue-2392.rs:77:12 | 77 | w.wrap.closure();//~ ERROR no method named `closure` found @@ -46,7 +46,7 @@ error: no method named `closure` found for type `Obj u32 {func}>` in the | = help: use `(w.wrap.closure)(...)` if you meant to call the function stored in the `closure` field -error: no method named `not_closure` found for type `Obj u32 {func}>` in the current scope +error[E0599]: no method named `not_closure` found for type `Obj u32 {func}>` in the current scope --> $DIR/issue-2392.rs:81:12 | 81 | w.wrap.not_closure(); @@ -54,7 +54,7 @@ error: no method named `not_closure` found for type `Obj u32 {func}>` in | = help: did you mean to write `w.wrap.not_closure` instead of `w.wrap.not_closure(...)`? -error: no method named `closure` found for type `Obj + 'static>>` in the current scope +error[E0599]: no method named `closure` found for type `Obj + 'static>>` in the current scope --> $DIR/issue-2392.rs:86:24 | 86 | check_expression().closure();//~ ERROR no method named `closure` found @@ -62,7 +62,7 @@ error: no method named `closure` found for type `Obj $DIR/issue-2392.rs:94:31 | 94 | (*self.container).f1(1); //~ ERROR no method named `f1` found @@ -70,7 +70,7 @@ error: no method named `f1` found for type `FuncContainer` in the current scope | = help: use `((*self.container).f1)(...)` if you meant to call the function stored in the `f1` field -error: no method named `f2` found for type `FuncContainer` in the current scope +error[E0599]: no method named `f2` found for type `FuncContainer` in the current scope --> $DIR/issue-2392.rs:97:31 | 97 | (*self.container).f2(1); //~ ERROR no method named `f2` found @@ -78,7 +78,7 @@ error: no method named `f2` found for type `FuncContainer` in the current scope | = help: use `((*self.container).f2)(...)` if you meant to call the function stored in the `f2` field -error: no method named `f3` found for type `FuncContainer` in the current scope +error[E0599]: no method named `f3` found for type `FuncContainer` in the current scope --> $DIR/issue-2392.rs:100:31 | 100 | (*self.container).f3(1); //~ ERROR no method named `f3` found diff --git a/src/test/ui/suggestions/confuse-field-and-method/issue-32128.stderr b/src/test/ui/suggestions/confuse-field-and-method/issue-32128.stderr index 704b7a37e9553..f1d8df8163987 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/issue-32128.stderr +++ b/src/test/ui/suggestions/confuse-field-and-method/issue-32128.stderr @@ -1,4 +1,4 @@ -error: no method named `example` found for type `Example` in the current scope +error[E0599]: no method named `example` found for type `Example` in the current scope --> $DIR/issue-32128.rs:22:10 | 22 | demo.example(1); diff --git a/src/test/ui/suggestions/confuse-field-and-method/issue-33784.stderr b/src/test/ui/suggestions/confuse-field-and-method/issue-33784.stderr index d827f89cf8d82..7918fc1e89d8c 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/issue-33784.stderr +++ b/src/test/ui/suggestions/confuse-field-and-method/issue-33784.stderr @@ -1,4 +1,4 @@ -error: no method named `closure` found for type `&Obj<[closure@$DIR/issue-33784.rs:35:43: 35:48]>` in the current scope +error[E0599]: no method named `closure` found for type `&Obj<[closure@$DIR/issue-33784.rs:35:43: 35:48]>` in the current scope --> $DIR/issue-33784.rs:37:7 | 37 | p.closure(); //~ ERROR no method named `closure` found @@ -6,7 +6,7 @@ error: no method named `closure` found for type `&Obj<[closure@$DIR/issue-33784. | = help: use `(p.closure)(...)` if you meant to call the function stored in the `closure` field -error: no method named `fn_ptr` found for type `&&Obj<[closure@$DIR/issue-33784.rs:35:43: 35:48]>` in the current scope +error[E0599]: no method named `fn_ptr` found for type `&&Obj<[closure@$DIR/issue-33784.rs:35:43: 35:48]>` in the current scope --> $DIR/issue-33784.rs:41:7 | 41 | q.fn_ptr(); //~ ERROR no method named `fn_ptr` found @@ -14,7 +14,7 @@ error: no method named `fn_ptr` found for type `&&Obj<[closure@$DIR/issue-33784. | = help: use `(q.fn_ptr)(...)` if you meant to call the function stored in the `fn_ptr` field -error: no method named `c_fn_ptr` found for type `&D` in the current scope +error[E0599]: no method named `c_fn_ptr` found for type `&D` in the current scope --> $DIR/issue-33784.rs:46:7 | 46 | s.c_fn_ptr(); //~ ERROR no method named `c_fn_ptr` found diff --git a/src/test/ui/suggestions/confuse-field-and-method/private-field.stderr b/src/test/ui/suggestions/confuse-field-and-method/private-field.stderr index e3c88c1e7bbbd..5b1c63822f907 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/private-field.stderr +++ b/src/test/ui/suggestions/confuse-field-and-method/private-field.stderr @@ -1,4 +1,4 @@ -error: no method named `dog_age` found for type `animal::Dog` in the current scope +error[E0599]: no method named `dog_age` found for type `animal::Dog` in the current scope --> $DIR/private-field.rs:26:23 | 26 | let dog_age = dog.dog_age();