about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/librustc_mir/diagnostics.rs4
-rw-r--r--src/librustc_mir/util/borrowck_errors.rs2
-rw-r--r--src/test/ui/borrowck/borrowck-borrow-from-temporary.nll.stderr4
-rw-r--r--src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.nll.stderr4
-rw-r--r--src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.nll.stderr4
-rw-r--r--src/test/ui/borrowck/promote-ref-mut-in-let-issue-46557.nll.stderr12
-rw-r--r--src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.nll.stderr8
-rw-r--r--src/test/ui/consts/const-eval/dont_promote_unstable_const_fn_cross_crate.nll.stderr6
-rw-r--r--src/test/ui/consts/const-eval/promoted_raw_ptr_ops.nll.stderr8
-rw-r--r--src/test/ui/consts/const-eval/transmute-const-promotion.nll.stderr4
-rw-r--r--src/test/ui/issues/issue-36082.mir.stderr4
-rw-r--r--src/test/ui/issues/issue-36082.rs2
-rw-r--r--src/test/ui/issues/issue-46472.rs2
-rw-r--r--src/test/ui/issues/issue-46472.stderr4
-rw-r--r--src/test/ui/issues/issue-47184.rs2
-rw-r--r--src/test/ui/issues/issue-47184.stderr4
-rw-r--r--src/test/ui/nll/borrowed-temporary-error.rs2
-rw-r--r--src/test/ui/nll/borrowed-temporary-error.stderr6
-rw-r--r--src/test/ui/nll/borrowed-universal-error.rs2
-rw-r--r--src/test/ui/nll/borrowed-universal-error.stderr6
-rw-r--r--src/test/ui/nll/issue-52534-1.stderr4
-rw-r--r--src/test/ui/nll/return-ref-mut-issue-46557.rs2
-rw-r--r--src/test/ui/nll/return-ref-mut-issue-46557.stderr6
-rw-r--r--src/test/ui/nll/user-annotations/patterns.rs6
-rw-r--r--src/test/ui/nll/user-annotations/patterns.stderr8
25 files changed, 58 insertions, 58 deletions
diff --git a/src/librustc_mir/diagnostics.rs b/src/librustc_mir/diagnostics.rs
index aac5fc5ed7e..75745849290 100644
--- a/src/librustc_mir/diagnostics.rs
+++ b/src/librustc_mir/diagnostics.rs
@@ -2263,13 +2263,13 @@ lifetime, which would again violate the `&mut`-borrow's exclusive
 access.
 "##,
 
-E0714: r##"
+E0716: r##"
 This error indicates that a temporary value is being dropped
 while a borrow is still in active use.
 
 Erroneous code example:
 
-```compile_fail,E0714
+```compile_fail,E0716
 # #![feature(nll)]
 fn foo() -> i32 { 22 }
 fn bar(x: &i32) -> &i32 { x }
diff --git a/src/librustc_mir/util/borrowck_errors.rs b/src/librustc_mir/util/borrowck_errors.rs
index c78020a2609..2616d0cd964 100644
--- a/src/librustc_mir/util/borrowck_errors.rs
+++ b/src/librustc_mir/util/borrowck_errors.rs
@@ -739,7 +739,7 @@ pub trait BorrowckErrors<'cx>: Sized + Copy {
         let err = struct_span_err!(
             self,
             span,
-            E0714,
+            E0716,
             "temporary value dropped while borrowed{OGN}",
             OGN = o
         );
diff --git a/src/test/ui/borrowck/borrowck-borrow-from-temporary.nll.stderr b/src/test/ui/borrowck/borrowck-borrow-from-temporary.nll.stderr
index 894eb4cc4a2..fe2bc0ca79b 100644
--- a/src/test/ui/borrowck/borrowck-borrow-from-temporary.nll.stderr
+++ b/src/test/ui/borrowck/borrowck-borrow-from-temporary.nll.stderr
@@ -1,4 +1,4 @@
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/borrowck-borrow-from-temporary.rs:19:24
    |
 LL |     let &Foo(ref x) = &id(Foo(3)); //~ ERROR borrowed value does not live long enough
@@ -15,4 +15,4 @@ LL | fn foo<'a>() -> &'a isize {
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0714`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.nll.stderr b/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.nll.stderr
index 1b5a1f4b29b..80c71b8e282 100644
--- a/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.nll.stderr
+++ b/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.nll.stderr
@@ -1,4 +1,4 @@
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/borrowck-borrowed-uniq-rvalue-2.rs:32:20
    |
 LL |     let x = defer(&vec!["Goodbye", "world!"]);
@@ -13,4 +13,4 @@ LL |     x.x[0];
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0714`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.nll.stderr b/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.nll.stderr
index 9236e9e2288..0c71ac793df 100644
--- a/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.nll.stderr
+++ b/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue.nll.stderr
@@ -1,4 +1,4 @@
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/borrowck-borrowed-uniq-rvalue.rs:20:28
    |
 LL |     buggy_map.insert(42, &*Box::new(1)); //~ ERROR borrowed value does not live long enough
@@ -13,4 +13,4 @@ LL |     buggy_map.insert(43, &*tmp);
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0714`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/borrowck/promote-ref-mut-in-let-issue-46557.nll.stderr b/src/test/ui/borrowck/promote-ref-mut-in-let-issue-46557.nll.stderr
index a4fc91f208d..101fb530a91 100644
--- a/src/test/ui/borrowck/promote-ref-mut-in-let-issue-46557.nll.stderr
+++ b/src/test/ui/borrowck/promote-ref-mut-in-let-issue-46557.nll.stderr
@@ -1,4 +1,4 @@
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/promote-ref-mut-in-let-issue-46557.rs:15:21
    |
 LL |     let ref mut x = 1234543; //~ ERROR
@@ -9,7 +9,7 @@ LL | }
    |
    = note: borrowed value must be valid for the static lifetime...
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/promote-ref-mut-in-let-issue-46557.rs:20:25
    |
 LL |     let (ref mut x, ) = (1234543, ); //~ ERROR
@@ -20,7 +20,7 @@ LL | }
    |
    = note: borrowed value must be valid for the static lifetime...
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/promote-ref-mut-in-let-issue-46557.rs:25:11
    |
 LL |     match 1234543 {
@@ -31,7 +31,7 @@ LL | }
    |
    = note: borrowed value must be valid for the static lifetime...
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/promote-ref-mut-in-let-issue-46557.rs:31:11
    |
 LL |     match (123443,) {
@@ -42,7 +42,7 @@ LL | }
    |
    = note: borrowed value must be valid for the static lifetime...
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/promote-ref-mut-in-let-issue-46557.rs:37:10
    |
 LL |     &mut 1234543 //~ ERROR
@@ -54,4 +54,4 @@ LL | }
 
 error: aborting due to 5 previous errors
 
-For more information about this error, try `rustc --explain E0714`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.nll.stderr b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.nll.stderr
index e257fdb31e7..fe7187af5f5 100644
--- a/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.nll.stderr
+++ b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn.nll.stderr
@@ -6,7 +6,7 @@ LL | const fn bar() -> u32 { foo() } //~ ERROR `foo` is not yet stable as a cons
    |
    = help: in Nightly builds, add `#![feature(foo)]` to the crate attributes to enable
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/dont_promote_unstable_const_fn.rs:28:28
    |
 LL |     let _: &'static u32 = &foo(); //~ ERROR does not live long enough
@@ -16,7 +16,7 @@ LL | }
    |
    = note: borrowed value must be valid for the static lifetime...
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/dont_promote_unstable_const_fn.rs:32:28
    |
 LL |     let _: &'static u32 = &meh(); //~ ERROR does not live long enough
@@ -27,7 +27,7 @@ LL | }
    |
    = note: borrowed value must be valid for the static lifetime...
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/dont_promote_unstable_const_fn.rs:33:26
    |
 LL |     let x: &'static _ = &std::time::Duration::from_millis(42).subsec_millis();
@@ -40,4 +40,4 @@ LL | }
 
 error: aborting due to 4 previous errors
 
-For more information about this error, try `rustc --explain E0714`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn_cross_crate.nll.stderr b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn_cross_crate.nll.stderr
index 6ec07336409..c4feb112901 100644
--- a/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn_cross_crate.nll.stderr
+++ b/src/test/ui/consts/const-eval/dont_promote_unstable_const_fn_cross_crate.nll.stderr
@@ -1,4 +1,4 @@
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/dont_promote_unstable_const_fn_cross_crate.rs:18:28
    |
 LL |     let _: &'static u32 = &foo(); //~ ERROR does not live long enough
@@ -9,7 +9,7 @@ LL | }
    |
    = note: borrowed value must be valid for the static lifetime...
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/dont_promote_unstable_const_fn_cross_crate.rs:19:29
    |
 LL |     let _x: &'static u32 = &foo(); //~ ERROR does not live long enough
@@ -21,4 +21,4 @@ LL | }
 
 error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0714`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.nll.stderr b/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.nll.stderr
index acc6104d9e2..bc8a99f5548 100644
--- a/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.nll.stderr
+++ b/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.nll.stderr
@@ -1,4 +1,4 @@
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/promoted_raw_ptr_ops.rs:14:29
    |
 LL |     let x: &'static bool = &(42 as *const i32 == 43 as *const i32);
@@ -9,7 +9,7 @@ LL | }
    |
    = note: borrowed value must be valid for the static lifetime...
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/promoted_raw_ptr_ops.rs:16:30
    |
 LL |     let y: &'static usize = &(&1 as *const i32 as usize + 1); //~ ERROR does not live long enough
@@ -20,7 +20,7 @@ LL | }
    |
    = note: borrowed value must be valid for the static lifetime...
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/promoted_raw_ptr_ops.rs:17:28
    |
 LL |     let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough
@@ -32,4 +32,4 @@ LL | }
 
 error: aborting due to 3 previous errors
 
-For more information about this error, try `rustc --explain E0714`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/consts/const-eval/transmute-const-promotion.nll.stderr b/src/test/ui/consts/const-eval/transmute-const-promotion.nll.stderr
index e11f589b105..cf3678e7d60 100644
--- a/src/test/ui/consts/const-eval/transmute-const-promotion.nll.stderr
+++ b/src/test/ui/consts/const-eval/transmute-const-promotion.nll.stderr
@@ -1,4 +1,4 @@
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/transmute-const-promotion.rs:16:37
    |
 LL |     let x: &'static u32 = unsafe { &mem::transmute(3.0f32) };
@@ -11,4 +11,4 @@ LL | }
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0714`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/issues/issue-36082.mir.stderr b/src/test/ui/issues/issue-36082.mir.stderr
index 4a481da6522..7fa7cee0aec 100644
--- a/src/test/ui/issues/issue-36082.mir.stderr
+++ b/src/test/ui/issues/issue-36082.mir.stderr
@@ -1,4 +1,4 @@
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/issue-36082.rs:23:19
    |
 LL |     let val: &_ = x.borrow().0;
@@ -13,4 +13,4 @@ LL |     println!("{}", val);
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0714`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/issues/issue-36082.rs b/src/test/ui/issues/issue-36082.rs
index 018d5bf0918..b8a498a4dc8 100644
--- a/src/test/ui/issues/issue-36082.rs
+++ b/src/test/ui/issues/issue-36082.rs
@@ -25,7 +25,7 @@ fn main() {
     //[ast]~| NOTE temporary value dropped here while still borrowed
     //[ast]~| NOTE temporary value does not live long enough
     //[ast]~| NOTE consider using a `let` binding to increase its lifetime
-    //[mir]~^^^^^ ERROR temporary value dropped while borrowed [E0714]
+    //[mir]~^^^^^ ERROR temporary value dropped while borrowed [E0716]
     //[mir]~| NOTE temporary value is freed at the end of this statement
     //[mir]~| NOTE creates a temporary which is freed while still in use
     //[mir]~| NOTE consider using a `let` binding to create a longer lived value
diff --git a/src/test/ui/issues/issue-46472.rs b/src/test/ui/issues/issue-46472.rs
index 79e805c5356..84e30a4d291 100644
--- a/src/test/ui/issues/issue-46472.rs
+++ b/src/test/ui/issues/issue-46472.rs
@@ -13,7 +13,7 @@
 fn bar<'a>() -> &'a mut u32 {
     &mut 4
     //~^ ERROR borrowed value does not live long enough (Ast) [E0597]
-    //~| ERROR temporary value dropped while borrowed (Mir) [E0714]
+    //~| ERROR temporary value dropped while borrowed (Mir) [E0716]
 }
 
 fn main() { }
diff --git a/src/test/ui/issues/issue-46472.stderr b/src/test/ui/issues/issue-46472.stderr
index 39c4e091fd2..4c0e6544a93 100644
--- a/src/test/ui/issues/issue-46472.stderr
+++ b/src/test/ui/issues/issue-46472.stderr
@@ -13,7 +13,7 @@ note: borrowed value must be valid for the lifetime 'a as defined on the functio
 LL | fn bar<'a>() -> &'a mut u32 {
    |        ^^
 
-error[E0714]: temporary value dropped while borrowed (Mir)
+error[E0716]: temporary value dropped while borrowed (Mir)
   --> $DIR/issue-46472.rs:14:10
    |
 LL |     &mut 4
@@ -30,5 +30,5 @@ LL | fn bar<'a>() -> &'a mut u32 {
 
 error: aborting due to 2 previous errors
 
-Some errors occurred: E0597, E0714.
+Some errors occurred: E0597, E0716.
 For more information about an error, try `rustc --explain E0597`.
diff --git a/src/test/ui/issues/issue-47184.rs b/src/test/ui/issues/issue-47184.rs
index fbf67a3b4fc..95d9d858ecd 100644
--- a/src/test/ui/issues/issue-47184.rs
+++ b/src/test/ui/issues/issue-47184.rs
@@ -12,5 +12,5 @@
 
 fn main() {
     let _vec: Vec<&'static String> = vec![&String::new()];
-    //~^ ERROR temporary value dropped while borrowed [E0714]
+    //~^ ERROR temporary value dropped while borrowed [E0716]
 }
diff --git a/src/test/ui/issues/issue-47184.stderr b/src/test/ui/issues/issue-47184.stderr
index 1a4b7ae16bf..4a8e9255723 100644
--- a/src/test/ui/issues/issue-47184.stderr
+++ b/src/test/ui/issues/issue-47184.stderr
@@ -1,4 +1,4 @@
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/issue-47184.rs:14:44
    |
 LL |     let _vec: Vec<&'static String> = vec![&String::new()];
@@ -10,4 +10,4 @@ LL |     let _vec: Vec<&'static String> = vec![&String::new()];
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0714`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/nll/borrowed-temporary-error.rs b/src/test/ui/nll/borrowed-temporary-error.rs
index d0b53359cd0..3bfb319ff31 100644
--- a/src/test/ui/nll/borrowed-temporary-error.rs
+++ b/src/test/ui/nll/borrowed-temporary-error.rs
@@ -18,7 +18,7 @@ fn main() {
     let x = gimme({
         let v = 22;
         &(v,)
-        //~^ ERROR temporary value dropped while borrowed [E0714]
+        //~^ ERROR temporary value dropped while borrowed [E0716]
     });
     println!("{:?}", x);
 }
diff --git a/src/test/ui/nll/borrowed-temporary-error.stderr b/src/test/ui/nll/borrowed-temporary-error.stderr
index a929914d8df..7f62f2ee52a 100644
--- a/src/test/ui/nll/borrowed-temporary-error.stderr
+++ b/src/test/ui/nll/borrowed-temporary-error.stderr
@@ -1,9 +1,9 @@
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/borrowed-temporary-error.rs:20:10
    |
 LL |         &(v,)
    |          ^^^^ creates a temporary which is freed while still in use
-LL |         //~^ ERROR temporary value dropped while borrowed [E0714]
+LL |         //~^ ERROR temporary value dropped while borrowed [E0716]
 LL |     });
    |       - temporary value is freed at the end of this statement
 LL |     println!("{:?}", x);
@@ -13,4 +13,4 @@ LL |     println!("{:?}", x);
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0714`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/nll/borrowed-universal-error.rs b/src/test/ui/nll/borrowed-universal-error.rs
index 5ea91d3618a..016a4f49e50 100644
--- a/src/test/ui/nll/borrowed-universal-error.rs
+++ b/src/test/ui/nll/borrowed-universal-error.rs
@@ -18,7 +18,7 @@ fn gimme(x: &(u32,)) -> &u32 {
 fn foo<'a>(x: &'a (u32,)) -> &'a u32 {
     let v = 22;
     gimme(&(v,))
-    //~^ ERROR temporary value dropped while borrowed [E0714]
+    //~^ ERROR temporary value dropped while borrowed [E0716]
 }
 
 fn main() {}
diff --git a/src/test/ui/nll/borrowed-universal-error.stderr b/src/test/ui/nll/borrowed-universal-error.stderr
index a65a396d2ab..d7ab5cec4a8 100644
--- a/src/test/ui/nll/borrowed-universal-error.stderr
+++ b/src/test/ui/nll/borrowed-universal-error.stderr
@@ -1,9 +1,9 @@
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/borrowed-universal-error.rs:20:12
    |
 LL |     gimme(&(v,))
    |            ^^^^ creates a temporary which is freed while still in use
-LL |     //~^ ERROR temporary value dropped while borrowed [E0714]
+LL |     //~^ ERROR temporary value dropped while borrowed [E0716]
 LL | }
    | - temporary value is freed at the end of this statement
    |
@@ -15,4 +15,4 @@ LL | fn foo<'a>(x: &'a (u32,)) -> &'a u32 {
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0714`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/nll/issue-52534-1.stderr b/src/test/ui/nll/issue-52534-1.stderr
index 9bb32c3ed3d..0d071915a3b 100644
--- a/src/test/ui/nll/issue-52534-1.stderr
+++ b/src/test/ui/nll/issue-52534-1.stderr
@@ -52,7 +52,7 @@ LL | }
    = note: functions cannot return a borrow to data owned within the function's scope, functions can only return borrows to data passed as arguments
    = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch04-02-references-and-borrowing.html#dangling-references>
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/issue-52534-1.rs:30:6
    |
 LL |     &&x
@@ -137,5 +137,5 @@ LL | }
 
 error: aborting due to 8 previous errors
 
-Some errors occurred: E0597, E0714.
+Some errors occurred: E0597, E0716.
 For more information about an error, try `rustc --explain E0597`.
diff --git a/src/test/ui/nll/return-ref-mut-issue-46557.rs b/src/test/ui/nll/return-ref-mut-issue-46557.rs
index 82222530335..e598147bdab 100644
--- a/src/test/ui/nll/return-ref-mut-issue-46557.rs
+++ b/src/test/ui/nll/return-ref-mut-issue-46557.rs
@@ -14,7 +14,7 @@
 #![allow(dead_code)]
 
 fn gimme_static_mut() -> &'static mut u32 {
-    let ref mut x = 1234543; //~ ERROR temporary value dropped while borrowed [E0714]
+    let ref mut x = 1234543; //~ ERROR temporary value dropped while borrowed [E0716]
     x
 }
 
diff --git a/src/test/ui/nll/return-ref-mut-issue-46557.stderr b/src/test/ui/nll/return-ref-mut-issue-46557.stderr
index 1e8224c8ddb..368cc677471 100644
--- a/src/test/ui/nll/return-ref-mut-issue-46557.stderr
+++ b/src/test/ui/nll/return-ref-mut-issue-46557.stderr
@@ -1,7 +1,7 @@
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/return-ref-mut-issue-46557.rs:17:21
    |
-LL |     let ref mut x = 1234543; //~ ERROR temporary value dropped while borrowed [E0714]
+LL |     let ref mut x = 1234543; //~ ERROR temporary value dropped while borrowed [E0716]
    |                     ^^^^^^^ creates a temporary which is freed while still in use
 LL |     x
 LL | }
@@ -11,4 +11,4 @@ LL | }
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0714`.
+For more information about this error, try `rustc --explain E0716`.
diff --git a/src/test/ui/nll/user-annotations/patterns.rs b/src/test/ui/nll/user-annotations/patterns.rs
index 971a7377024..e3bac513fa8 100644
--- a/src/test/ui/nll/user-annotations/patterns.rs
+++ b/src/test/ui/nll/user-annotations/patterns.rs
@@ -51,13 +51,13 @@ fn underscore_with_initializer() {
     let _: &'static u32 = &x; //~ ERROR
 
     let _: Vec<&'static String> = vec![&String::new()];
-    //~^ ERROR temporary value dropped while borrowed [E0714]
+    //~^ ERROR temporary value dropped while borrowed [E0716]
 
     let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44);
-    //~^ ERROR temporary value dropped while borrowed [E0714]
+    //~^ ERROR temporary value dropped while borrowed [E0716]
 
     let (_a, b): (Vec<&'static String>, _) = (vec![&String::new()], 44);
-    //~^ ERROR temporary value dropped while borrowed [E0714]
+    //~^ ERROR temporary value dropped while borrowed [E0716]
 }
 
 fn pair_underscores_with_initializer() {
diff --git a/src/test/ui/nll/user-annotations/patterns.stderr b/src/test/ui/nll/user-annotations/patterns.stderr
index 0e3109413bd..b01dc65fc5f 100644
--- a/src/test/ui/nll/user-annotations/patterns.stderr
+++ b/src/test/ui/nll/user-annotations/patterns.stderr
@@ -40,7 +40,7 @@ LL | }
    |
    = note: borrowed value must be valid for the static lifetime...
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/patterns.rs:53:41
    |
 LL |     let _: Vec<&'static String> = vec![&String::new()];
@@ -50,7 +50,7 @@ LL |     let _: Vec<&'static String> = vec![&String::new()];
    |
    = note: borrowed value must be valid for the static lifetime...
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/patterns.rs:56:52
    |
 LL |     let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44);
@@ -60,7 +60,7 @@ LL |     let (_, a): (Vec<&'static String>, _) = (vec![&String::new()], 44);
    |
    = note: borrowed value must be valid for the static lifetime...
 
-error[E0714]: temporary value dropped while borrowed
+error[E0716]: temporary value dropped while borrowed
   --> $DIR/patterns.rs:59:53
    |
 LL |     let (_a, b): (Vec<&'static String>, _) = (vec![&String::new()], 44);
@@ -140,5 +140,5 @@ LL |     let (y, _z): (&'static u32, u32) = (x, 44); //~ ERROR
 
 error: aborting due to 14 previous errors
 
-Some errors occurred: E0597, E0714.
+Some errors occurred: E0597, E0716.
 For more information about an error, try `rustc --explain E0597`.