about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'src/test')
-rw-r--r--src/test/compile-fail/E0596.rs14
-rw-r--r--src/test/compile-fail/E0597.rs19
-rw-r--r--src/test/compile-fail/E0600.rs13
-rw-r--r--src/test/ui/codemap_tests/huge_multispan_highlight.stderr2
-rw-r--r--src/test/ui/codemap_tests/issue-28308.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-31424.stderr4
-rw-r--r--src/test/ui/did_you_mean/issue-34126.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-34337.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-35937.stderr6
-rw-r--r--src/test/ui/did_you_mean/issue-37139.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-38147-2.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-38147-3.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-39544.stderr24
-rw-r--r--src/test/ui/did_you_mean/issue-40823.stderr2
-rw-r--r--src/test/ui/dropck/dropck-eyepatch-extern-crate.stderr8
-rw-r--r--src/test/ui/dropck/dropck-eyepatch-reorder.stderr8
-rw-r--r--src/test/ui/dropck/dropck-eyepatch.stderr8
-rw-r--r--src/test/ui/issue-41652/issue_41652.stderr2
-rw-r--r--src/test/ui/lifetimes/borrowck-let-suggestion.stderr2
-rw-r--r--src/test/ui/macros/macro-backtrace-invalid-internals.stderr4
-rw-r--r--src/test/ui/mismatched_types/issue-36053-2.stderr2
-rw-r--r--src/test/ui/mismatched_types/method-help-unsatisfied-bound.stderr2
-rw-r--r--src/test/ui/reachable/expr_unary.stderr2
-rw-r--r--src/test/ui/span/borrowck-borrow-overloaded-auto-deref-mut.stderr16
-rw-r--r--src/test/ui/span/borrowck-borrow-overloaded-deref-mut.stderr8
-rw-r--r--src/test/ui/span/borrowck-call-is-borrow-issue-12224.stderr4
-rw-r--r--src/test/ui/span/borrowck-call-method-from-mut-aliasable.stderr2
-rw-r--r--src/test/ui/span/borrowck-fn-in-const-b.stderr2
-rw-r--r--src/test/ui/span/borrowck-let-suggestion-suffixes.stderr8
-rw-r--r--src/test/ui/span/borrowck-object-mutability.stderr4
-rw-r--r--src/test/ui/span/borrowck-ref-into-rvalue.stderr2
-rw-r--r--src/test/ui/span/destructor-restrictions.stderr2
-rw-r--r--src/test/ui/span/dropck-object-cycle.stderr2
-rw-r--r--src/test/ui/span/dropck_arr_cycle_checked.stderr12
-rw-r--r--src/test/ui/span/dropck_direct_cycle_with_drop.stderr4
-rw-r--r--src/test/ui/span/dropck_misc_variants.stderr4
-rw-r--r--src/test/ui/span/dropck_vec_cycle_checked.stderr12
-rw-r--r--src/test/ui/span/issue-11925.stderr2
-rw-r--r--src/test/ui/span/issue-15480.stderr2
-rw-r--r--src/test/ui/span/issue-23338-locals-die-before-temps-of-body.stderr4
-rw-r--r--src/test/ui/span/issue-24805-dropck-child-has-items-via-parent.stderr2
-rw-r--r--src/test/ui/span/issue-24805-dropck-trait-has-items.stderr6
-rw-r--r--src/test/ui/span/issue-24895-copy-clone-dropck.stderr2
-rw-r--r--src/test/ui/span/issue-25199.stderr4
-rw-r--r--src/test/ui/span/issue-26656.stderr2
-rw-r--r--src/test/ui/span/issue-29106.stderr4
-rw-r--r--src/test/ui/span/issue-36537.stderr2
-rw-r--r--src/test/ui/span/issue-40157.stderr2
-rw-r--r--src/test/ui/span/issue-7575.stderr6
-rw-r--r--src/test/ui/span/issue28498-reject-ex1.stderr4
-rw-r--r--src/test/ui/span/issue28498-reject-lifetime-param.stderr4
-rw-r--r--src/test/ui/span/issue28498-reject-passed-to-fn.stderr4
-rw-r--r--src/test/ui/span/issue28498-reject-trait-bound.stderr4
-rw-r--r--src/test/ui/span/loan-extend.stderr2
-rw-r--r--src/test/ui/span/mut-arg-hint.stderr6
-rw-r--r--src/test/ui/span/mut-ptr-cant-outlive-ref.stderr2
-rw-r--r--src/test/ui/span/range-2.stderr4
-rw-r--r--src/test/ui/span/regionck-unboxed-closure-lifetimes.stderr2
-rw-r--r--src/test/ui/span/regions-close-over-borrowed-ref-in-obj.stderr2
-rw-r--r--src/test/ui/span/regions-close-over-type-parameter-2.stderr2
-rw-r--r--src/test/ui/span/regions-escape-loop-via-variable.stderr2
-rw-r--r--src/test/ui/span/regions-escape-loop-via-vec.stderr2
-rw-r--r--src/test/ui/span/regions-infer-borrow-scope-within-loop.stderr2
-rw-r--r--src/test/ui/span/send-is-not-static-ensures-scoping.stderr4
-rw-r--r--src/test/ui/span/send-is-not-static-std-sync-2.stderr6
-rw-r--r--src/test/ui/span/send-is-not-static-std-sync.stderr6
-rw-r--r--src/test/ui/span/slice-borrow.stderr2
-rw-r--r--src/test/ui/span/vec-must-not-hide-type-from-dropck.stderr4
-rw-r--r--src/test/ui/span/vec_refs_data_with_early_death.stderr4
-rw-r--r--src/test/ui/span/wf-method-late-bound-regions.stderr2
-rw-r--r--src/test/ui/suggestions/confuse-field-and-method/issue-18343.stderr2
-rw-r--r--src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr22
-rw-r--r--src/test/ui/suggestions/confuse-field-and-method/issue-32128.stderr2
-rw-r--r--src/test/ui/suggestions/confuse-field-and-method/issue-33784.stderr6
-rw-r--r--src/test/ui/suggestions/confuse-field-and-method/private-field.stderr2
75 files changed, 202 insertions, 156 deletions
diff --git a/src/test/compile-fail/E0596.rs b/src/test/compile-fail/E0596.rs
new file mode 100644
index 00000000000..1f1af69d977
--- /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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 00000000000..00ef14a8e2a
--- /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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 00000000000..5457ff26608
--- /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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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 059215157ec..46b3db18e8a 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 5e611d42a14..43743b796d5 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 1bd8d512833..eecb164a83f 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 606d6b2b259..d5d6ee133b8 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 c32fb56f61b..2769c74be5e 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 09a9b796c6a..4760d28566f 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 acbeaafdf79..6debbaadb1a 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 83d46e3fc47..2834fc6262f 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 ca6f376ffd3..d950e82003c 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 9ae240bf420..94afe896d5e 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 5718471527d..a034ea80969 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 b69b4f9f321..a5a3c48ab97 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 ddd213dd9ad..de04a1c4283 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 d9d00919b6d..26fee852fb2 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 a0177e79ac4..4625e9269c9 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 768057301d1..2bc0acd626c 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 304d4459e49..2c83a84f004 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 d72ab326ce6..8b756814ced 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<std::iter::Fuse<std::iter::Once<&str>>, [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<std::iter::Fuse<std::iter::Once<&str>>, [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 c7a52fea3bc..80f95da0bbe 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 889e3e01c6d..f47791455af 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 7cd9f30f42c..4b01f5bea7c 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<Point>) {
@@ -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<Point>) -> &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<Point>) {
@@ -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<Point>) {
@@ -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<Point>) {
@@ -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<Point>) -> &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<Point>) {
@@ -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<Point>) {
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 83c49409049..886cc142039 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<isize>) {
@@ -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<isize>) -> &'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<isize>) {
@@ -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<isize>) {
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 bfb51ba4816..a26ca490dd5 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: &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 00fa6577545..dea95d6bf6d 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 75866b7e45e..3bf56881c54 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<String>) {
diff --git a/src/test/ui/span/borrowck-let-suggestion-suffixes.stderr b/src/test/ui/span/borrowck-let-suggestion-suffixes.stderr
index fd2a752c472..04dbcd2ef49 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 86316d8980d..877b17dc27d 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<Foo>) {
diff --git a/src/test/ui/span/borrowck-ref-into-rvalue.stderr b/src/test/ui/span/borrowck-ref-into-rvalue.stderr
index 38ce3d398ba..e0a484bcb37 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 bf449518ce7..1472a364863 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 f0984485279..d0fceb2a03e 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 ea5163cf924..2a9c2c8413f 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 d5f22a26650..e6421cd4785 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 4ad98b429c5..7fbdcba7eb6 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 e38c49d6a5c..3861b145c1b 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 18cbf933230..67d60fe085a 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 d2534388f72..f5f987c823f 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 bf7c099187e..e564b7ccef2 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 8c2254483e0..314ef0ecbbc 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 450bc123e60..66f22d14578 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 dfee66ae546..cfa8359088a 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 17c05557297..999871db093 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 1f5c64986c7..b4f0195f6a8 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 2a7e59f0422..b645cbf402d 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 dbce171dd9b..df06cd1d0ea 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 160f65fd1b9..50183aa3bde 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 c017e386808..9f368f0de96 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 06b7f922b68..a2ef99f9d76 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 d166af52247..cb77cd3dc99 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 6a02d701573..49116c340ec 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 91a410e0f65..bb4de82422a 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 6095a3b6be5..036c4bd6b8d 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 d5e6b628655..754e96aa808 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 68dc87d0667..5bd6a786cfd 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 4f638562bb8..465a663a741 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 6c5007a5705..80dadd97a17 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 d6a460d83ab..25386cb30b1 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 099f6df27ef..9b5383877a0 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 09178ce57e8..9f8c91cb9cd 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 006060f342a..4f0e61f1133 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 d4dfef36e4a..43103e619a5 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 4a815a58b35..b5e55adfb45 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 815f8802267..2845c4f6bda 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 81f53c7f374..3d75a1b717a 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 ff6d30d670d..0c07d068d28 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 fad46d5a7d0..0efbd8472ae 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 c890d4740e6..0dee15b4231 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 ff1bf47d44d..d5e663ff26d 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 0f2097dfb31..b69d90cf8f7 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 0191060e837..21865323908 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<fn() -> u32 {func}>` in the current scope
+error[E0599]: no method named `closure` found for type `Obj<fn() -> 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<fn() -> 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<fn() -> u32 {func}>` in the current scope
+error[E0599]: no method named `closure` found for type `Obj<fn() -> 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<fn() -> 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<fn() -> u32 {func}>` in the current scope
+error[E0599]: no method named `not_closure` found for type `Obj<fn() -> 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<fn() -> 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<std::boxed::Box<std::boxed::FnBox<(), Output=u32> + 'static>>` in the current scope
+error[E0599]: no method named `closure` found for type `Obj<std::boxed::Box<std::boxed::FnBox<(), Output=u32> + '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<std::boxed::Box<std::boxed:
    |
    = help: use `(check_expression().closure)(...)` if you meant to call the function stored in the `closure` field
 
-error: no method named `f1` found for type `FuncContainer` in the current scope
+error[E0599]: no method named `f1` found for type `FuncContainer` in the current scope
   --> $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 704b7a37e95..f1d8df81639 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 d827f89cf8d..7918fc1e89d 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 e3c88c1e7bb..5b1c63822f9 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();