about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2018-04-12 12:25:29 +0200
committerFelix S. Klock II <pnkfelix@pnkfx.org>2018-04-18 15:37:18 +0200
commitea454746b31cfdd1c9f08b3ea11fff4ef19b58e7 (patch)
tree3c740ff9f29cb763ac34a34b393aaa63d2a30c6d
parent02a7809f1c10ceab7ffe4652f1211cdc3c6fd4c1 (diff)
downloadrust-ea454746b31cfdd1c9f08b3ea11fff4ef19b58e7.tar.gz
rust-ea454746b31cfdd1c9f08b3ea11fff4ef19b58e7.zip
Update the previously checkpointed (but unused by bors) tests to reflect current reality.
-rw-r--r--src/test/ui/borrowck/issue-45983.nll.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-34126.nll.stderr11
-rw-r--r--src/test/ui/did_you_mean/issue-35937.nll.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-38147-1.nll.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-38147-4.nll.stderr2
-rw-r--r--src/test/ui/did_you_mean/issue-39544.nll.stderr22
-rw-r--r--src/test/ui/error-codes/E0389.nll.stderr8
-rw-r--r--src/test/ui/hygiene/fields-move.nll.stderr46
-rw-r--r--src/test/ui/hygiene/fields-numeric-borrowck.nll.stderr13
-rw-r--r--src/test/ui/hygiene/fields-numeric-borrowck.rs4
-rw-r--r--src/test/ui/issue-36400.nll.stderr2
-rw-r--r--src/test/ui/rfc-2005-default-binding-mode/enum.nll.stderr18
-rw-r--r--src/test/ui/rfc-2005-default-binding-mode/explicit-mut.nll.stderr18
-rw-r--r--src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr2
-rw-r--r--src/test/ui/span/borrowck-object-mutability.nll.stderr2
-rw-r--r--src/test/ui/span/destructor-restrictions.nll.stderr16
-rw-r--r--src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr30
-rw-r--r--src/test/ui/span/wf-method-late-bound-regions.nll.stderr20
-rw-r--r--src/test/ui/span/wf-method-late-bound-regions.rs4
19 files changed, 174 insertions, 50 deletions
diff --git a/src/test/ui/borrowck/issue-45983.nll.stderr b/src/test/ui/borrowck/issue-45983.nll.stderr
index ecd17edb079..d949ebae325 100644
--- a/src/test/ui/borrowck/issue-45983.nll.stderr
+++ b/src/test/ui/borrowck/issue-45983.nll.stderr
@@ -16,7 +16,7 @@ error[E0594]: cannot assign to immutable item `x`
 LL |     give_any(|y| x = Some(y));
    |                  ^^^^^^^^^^^ cannot mutate
    |
-   = note: Value not mutable causing this error: `x`
+   = note: the value which is causing this path not to be mutable is...: `x`
 
 error[E0596]: cannot borrow immutable item `x` as mutable
   --> $DIR/issue-45983.rs:17:14
diff --git a/src/test/ui/did_you_mean/issue-34126.nll.stderr b/src/test/ui/did_you_mean/issue-34126.nll.stderr
index afdc26a75c7..81f858f6bfc 100644
--- a/src/test/ui/did_you_mean/issue-34126.nll.stderr
+++ b/src/test/ui/did_you_mean/issue-34126.nll.stderr
@@ -1,3 +1,9 @@
+error[E0596]: cannot borrow immutable item `self` as mutable
+  --> $DIR/issue-34126.rs:16:18
+   |
+LL |         self.run(&mut self); //~ ERROR cannot borrow
+   |                  ^^^^^^^^^ cannot borrow as mutable
+
 error[E0502]: cannot borrow `self` as mutable because it is also borrowed as immutable
   --> $DIR/issue-34126.rs:16:18
    |
@@ -8,6 +14,7 @@ LL |         self.run(&mut self); //~ ERROR cannot borrow
    |         immutable borrow occurs here
    |         borrow later used here
 
-error: aborting due to previous error
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0502`.
+Some errors occurred: E0502, E0596.
+For more information about an error, try `rustc --explain E0502`.
diff --git a/src/test/ui/did_you_mean/issue-35937.nll.stderr b/src/test/ui/did_you_mean/issue-35937.nll.stderr
index 7b5f452d322..40b640b63cf 100644
--- a/src/test/ui/did_you_mean/issue-35937.nll.stderr
+++ b/src/test/ui/did_you_mean/issue-35937.nll.stderr
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `f.v` as mutable
 LL |     f.v.push("cat".to_string()); //~ ERROR cannot borrow
    |     ^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `f`
+   = note: the value which is causing this path not to be mutable is...: `f`
 
 error[E0384]: cannot assign twice to immutable variable `s.x`
   --> $DIR/issue-35937.rs:26:5
diff --git a/src/test/ui/did_you_mean/issue-38147-1.nll.stderr b/src/test/ui/did_you_mean/issue-38147-1.nll.stderr
index 099479eaf2b..8e442677951 100644
--- a/src/test/ui/did_you_mean/issue-38147-1.nll.stderr
+++ b/src/test/ui/did_you_mean/issue-38147-1.nll.stderr
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `*self.s` as mutable
 LL |         self.s.push('x'); //~ ERROR cannot borrow data mutably
    |         ^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*self`
+   = note: the value which is causing this path not to be mutable is...: `*self`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/did_you_mean/issue-38147-4.nll.stderr b/src/test/ui/did_you_mean/issue-38147-4.nll.stderr
index 5649fc903a0..6808222cc32 100644
--- a/src/test/ui/did_you_mean/issue-38147-4.nll.stderr
+++ b/src/test/ui/did_you_mean/issue-38147-4.nll.stderr
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `*f.s` as mutable
 LL |     f.s.push('x'); //~ ERROR cannot borrow data mutably
    |     ^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*f`
+   = note: the value which is causing this path not to be mutable is...: `*f`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/did_you_mean/issue-39544.nll.stderr b/src/test/ui/did_you_mean/issue-39544.nll.stderr
index 6e57796aa45..f5f5b675e77 100644
--- a/src/test/ui/did_you_mean/issue-39544.nll.stderr
+++ b/src/test/ui/did_you_mean/issue-39544.nll.stderr
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `z.x` as mutable
 LL |     let _ = &mut z.x; //~ ERROR cannot borrow
    |             ^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `z`
+   = note: the value which is causing this path not to be mutable is...: `z`
 
 error[E0596]: cannot borrow immutable item `self.x` as mutable
   --> $DIR/issue-39544.rs:26:17
@@ -12,7 +12,7 @@ error[E0596]: cannot borrow immutable item `self.x` as mutable
 LL |         let _ = &mut self.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*self`
+   = note: the value which is causing this path not to be mutable is...: `*self`
 
 error[E0596]: cannot borrow immutable item `self.x` as mutable
   --> $DIR/issue-39544.rs:30:17
@@ -20,7 +20,7 @@ error[E0596]: cannot borrow immutable item `self.x` as mutable
 LL |         let _ = &mut self.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*self`
+   = note: the value which is causing this path not to be mutable is...: `*self`
 
 error[E0596]: cannot borrow immutable item `other.x` as mutable
   --> $DIR/issue-39544.rs:31:17
@@ -28,7 +28,7 @@ error[E0596]: cannot borrow immutable item `other.x` as mutable
 LL |         let _ = &mut other.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*other`
+   = note: the value which is causing this path not to be mutable is...: `*other`
 
 error[E0596]: cannot borrow immutable item `self.x` as mutable
   --> $DIR/issue-39544.rs:35:17
@@ -36,7 +36,7 @@ error[E0596]: cannot borrow immutable item `self.x` as mutable
 LL |         let _ = &mut self.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*self`
+   = note: the value which is causing this path not to be mutable is...: `*self`
 
 error[E0596]: cannot borrow immutable item `other.x` as mutable
   --> $DIR/issue-39544.rs:36:17
@@ -44,7 +44,7 @@ error[E0596]: cannot borrow immutable item `other.x` as mutable
 LL |         let _ = &mut other.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*other`
+   = note: the value which is causing this path not to be mutable is...: `*other`
 
 error[E0596]: cannot borrow immutable item `self.x` as mutable
   --> $DIR/issue-39544.rs:40:17
@@ -52,7 +52,7 @@ error[E0596]: cannot borrow immutable item `self.x` as mutable
 LL |         let _ = &mut self.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*self`
+   = note: the value which is causing this path not to be mutable is...: `*self`
 
 error[E0596]: cannot borrow immutable item `other.x` as mutable
   --> $DIR/issue-39544.rs:41:17
@@ -60,7 +60,7 @@ error[E0596]: cannot borrow immutable item `other.x` as mutable
 LL |         let _ = &mut other.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*other`
+   = note: the value which is causing this path not to be mutable is...: `*other`
 
 error[E0596]: cannot borrow immutable item `other.x` as mutable
   --> $DIR/issue-39544.rs:45:17
@@ -68,7 +68,7 @@ error[E0596]: cannot borrow immutable item `other.x` as mutable
 LL |         let _ = &mut other.x; //~ ERROR cannot borrow
    |                 ^^^^^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*other`
+   = note: the value which is causing this path not to be mutable is...: `*other`
 
 error[E0596]: cannot borrow immutable item `z.x` as mutable
   --> $DIR/issue-39544.rs:51:13
@@ -76,7 +76,7 @@ error[E0596]: cannot borrow immutable item `z.x` as mutable
 LL |     let _ = &mut z.x; //~ ERROR cannot borrow
    |             ^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `z`
+   = note: the value which is causing this path not to be mutable is...: `z`
 
 error[E0596]: cannot borrow immutable item `w.x` as mutable
   --> $DIR/issue-39544.rs:52:13
@@ -84,7 +84,7 @@ error[E0596]: cannot borrow immutable item `w.x` as mutable
 LL |     let _ = &mut w.x; //~ ERROR cannot borrow
    |             ^^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*w`
+   = note: the value which is causing this path not to be mutable is...: `*w`
 
 error[E0594]: cannot assign to immutable item `*x.0`
   --> $DIR/issue-39544.rs:58:5
diff --git a/src/test/ui/error-codes/E0389.nll.stderr b/src/test/ui/error-codes/E0389.nll.stderr
index 13ba653a5ca..0525e16239d 100644
--- a/src/test/ui/error-codes/E0389.nll.stderr
+++ b/src/test/ui/error-codes/E0389.nll.stderr
@@ -1,10 +1,10 @@
-error[E0594]: cannot assign to immutable item `fancy_ref.num`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/E0389.rs:18:5
    |
+LL |     let fancy_ref = &(&mut fancy);
+   |                     ------------- help: consider changing this to be a mutable reference: `&mut (&mut fancy)`
 LL |     fancy_ref.num = 6; //~ ERROR E0389
-   |     ^^^^^^^^^^^^^^^^^ cannot mutate
-   |
-   = note: Value not mutable causing this error: `*fancy_ref`
+   |     ^^^^^^^^^^^^^^^^^ `fancy_ref` is a `&` reference, so the data it refers to cannot be written
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/hygiene/fields-move.nll.stderr b/src/test/ui/hygiene/fields-move.nll.stderr
new file mode 100644
index 00000000000..51f8067b8ce
--- /dev/null
+++ b/src/test/ui/hygiene/fields-move.nll.stderr
@@ -0,0 +1,46 @@
+error[E0382]: use of moved value: `foo.x`
+  --> $DIR/fields-move.rs:38:42
+   |
+LL |    $foo.x
+   |    ------ value moved here
+...
+LL |     assert_two_copies(copy_modern!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
+   |                                          ^^^^^ value used here after move
+   |
+   = note: move occurs because `foo.x` has type `NonCopy`, which does not implement the `Copy` trait
+
+error[E0382]: use of moved value: `foo.x`
+  --> $DIR/fields-move.rs:28:9
+   |
+LL |    $foo.x
+   |    ------ value moved here
+...
+LL |         $foo.x //~ ERROR use of moved value: `foo.x`
+   |         ^^^^^^ value used here after move
+...
+LL |     assert_two_copies(copy_modern!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
+   |                                          ----- value moved here
+LL |     assert_two_copies(copy_legacy!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
+   |                       ----------------- in this macro invocation
+   |
+   = note: move occurs because `foo.x` has type `NonCopy`, which does not implement the `Copy` trait
+
+error[E0382]: use of moved value: `foo.x`
+  --> $DIR/fields-move.rs:39:42
+   |
+LL |    $foo.x
+   |    ------ value moved here
+...
+LL |         $foo.x //~ ERROR use of moved value: `foo.x`
+   |         ------ value moved here
+...
+LL |     assert_two_copies(copy_modern!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
+   |                                          ----- value moved here
+LL |     assert_two_copies(copy_legacy!(foo), foo.x); //~ ERROR use of moved value: `foo.x`
+   |                                          ^^^^^ value used here after move
+   |
+   = note: move occurs because `foo.x` has type `NonCopy`, which does not implement the `Copy` trait
+
+error: aborting due to 3 previous errors
+
+For more information about this error, try `rustc --explain E0382`.
diff --git a/src/test/ui/hygiene/fields-numeric-borrowck.nll.stderr b/src/test/ui/hygiene/fields-numeric-borrowck.nll.stderr
new file mode 100644
index 00000000000..3a0a6f66d61
--- /dev/null
+++ b/src/test/ui/hygiene/fields-numeric-borrowck.nll.stderr
@@ -0,0 +1,13 @@
+error: compilation successful
+  --> $DIR/fields-numeric-borrowck.rs:13:1
+   |
+LL | / fn main() { #![rustc_error] // rust-lang/rust#49855
+LL | |     let mut s = S(0);
+LL | |     let borrow1 = &mut s.0;
+LL | |     let S { 0: ref mut borrow2 } = s;
+LL | |     //~^ ERROR cannot borrow `s.0` as mutable more than once at a time
+LL | | }
+   | |_^
+
+error: aborting due to previous error
+
diff --git a/src/test/ui/hygiene/fields-numeric-borrowck.rs b/src/test/ui/hygiene/fields-numeric-borrowck.rs
index 50ace39e709..975684fbd41 100644
--- a/src/test/ui/hygiene/fields-numeric-borrowck.rs
+++ b/src/test/ui/hygiene/fields-numeric-borrowck.rs
@@ -7,10 +7,10 @@
 // <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.
-
+#![feature(rustc_attrs)]
 struct S(u8);
 
-fn main() {
+fn main() { #![rustc_error] // rust-lang/rust#49855
     let mut s = S(0);
     let borrow1 = &mut s.0;
     let S { 0: ref mut borrow2 } = s;
diff --git a/src/test/ui/issue-36400.nll.stderr b/src/test/ui/issue-36400.nll.stderr
index 040e6300af6..80459937479 100644
--- a/src/test/ui/issue-36400.nll.stderr
+++ b/src/test/ui/issue-36400.nll.stderr
@@ -4,7 +4,7 @@ error[E0596]: cannot borrow immutable item `*x` as mutable
 LL |     f(&mut *x); //~ ERROR cannot borrow immutable
    |       ^^^^^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `x`
+   = note: the value which is causing this path not to be mutable is...: `x`
 
 error: aborting due to previous error
 
diff --git a/src/test/ui/rfc-2005-default-binding-mode/enum.nll.stderr b/src/test/ui/rfc-2005-default-binding-mode/enum.nll.stderr
index 6ae5f777a93..b97bdeea409 100644
--- a/src/test/ui/rfc-2005-default-binding-mode/enum.nll.stderr
+++ b/src/test/ui/rfc-2005-default-binding-mode/enum.nll.stderr
@@ -1,20 +1,26 @@
-error[E0594]: cannot assign to immutable item `*x`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/enum.rs:19:5
    |
+LL |     let Wrap(x) = &Wrap(3);
+   |              - help: consider changing this to be a mutable reference: `&mut`
 LL |     *x += 1; //~ ERROR cannot assign to immutable
-   |     ^^^^^^^ cannot mutate
+   |     ^^^^^^^
 
-error[E0594]: cannot assign to immutable item `*x`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/enum.rs:23:9
    |
+LL |     if let Some(x) = &Some(3) {
+   |                 - help: consider changing this to be a mutable reference: `&mut`
 LL |         *x += 1; //~ ERROR cannot assign to immutable
-   |         ^^^^^^^ cannot mutate
+   |         ^^^^^^^
 
-error[E0594]: cannot assign to immutable item `*x`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/enum.rs:29:9
    |
+LL |     while let Some(x) = &Some(3) {
+   |                    - help: consider changing this to be a mutable reference: `&mut`
 LL |         *x += 1; //~ ERROR cannot assign to immutable
-   |         ^^^^^^^ cannot mutate
+   |         ^^^^^^^
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.nll.stderr b/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.nll.stderr
index 7138c4ac06e..3ee4dc07bb8 100644
--- a/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.nll.stderr
+++ b/src/test/ui/rfc-2005-default-binding-mode/explicit-mut.nll.stderr
@@ -1,20 +1,26 @@
-error[E0594]: cannot assign to immutable item `*n`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/explicit-mut.rs:17:13
    |
+LL |         Some(n) => {
+   |              - help: consider changing this to be a mutable reference: `&mut`
 LL |             *n += 1; //~ ERROR cannot assign to immutable
-   |             ^^^^^^^ cannot mutate
+   |             ^^^^^^^
 
-error[E0594]: cannot assign to immutable item `*n`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/explicit-mut.rs:25:13
    |
+LL |         Some(n) => {
+   |              - help: consider changing this to be a mutable reference: `&mut`
 LL |             *n += 1; //~ ERROR cannot assign to immutable
-   |             ^^^^^^^ cannot mutate
+   |             ^^^^^^^
 
-error[E0594]: cannot assign to immutable item `*n`
+error[E0594]: cannot assign to data in a `&` reference
   --> $DIR/explicit-mut.rs:33:13
    |
+LL |         Some(n) => {
+   |              - help: consider changing this to be a mutable reference: `&mut`
 LL |             *n += 1; //~ ERROR cannot assign to immutable
-   |             ^^^^^^^ cannot mutate
+   |             ^^^^^^^
 
 error: aborting due to 3 previous errors
 
diff --git a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr
index 505ee95088f..26e9ea4dc0b 100644
--- a/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr
+++ b/src/test/ui/span/borrowck-call-is-borrow-issue-12224.nll.stderr
@@ -24,7 +24,7 @@ error[E0596]: cannot borrow immutable item `*f.f` as mutable
 LL |     f.f.call_mut(())
    |     ^^^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `*f`
+   = note: the value which is causing this path not to be mutable is...: `*f`
 
 error[E0507]: cannot move out of borrowed content
   --> $DIR/borrowck-call-is-borrow-issue-12224.rs:66:13
diff --git a/src/test/ui/span/borrowck-object-mutability.nll.stderr b/src/test/ui/span/borrowck-object-mutability.nll.stderr
index 100b5ae150a..9b5e084bd37 100644
--- a/src/test/ui/span/borrowck-object-mutability.nll.stderr
+++ b/src/test/ui/span/borrowck-object-mutability.nll.stderr
@@ -10,7 +10,7 @@ error[E0596]: cannot borrow immutable item `*x` as mutable
 LL |     x.borrowed_mut(); //~ ERROR cannot borrow
    |     ^ cannot borrow as mutable
    |
-   = note: Value not mutable causing this error: `x`
+   = note: the value which is causing this path not to be mutable is...: `x`
 
 error: aborting due to 2 previous errors
 
diff --git a/src/test/ui/span/destructor-restrictions.nll.stderr b/src/test/ui/span/destructor-restrictions.nll.stderr
index e69de29bb2d..5de246cbb73 100644
--- a/src/test/ui/span/destructor-restrictions.nll.stderr
+++ b/src/test/ui/span/destructor-restrictions.nll.stderr
@@ -0,0 +1,16 @@
+error[E0597]: `*a` does not live long enough
+  --> $DIR/destructor-restrictions.rs:18:10
+   |
+LL |         *a.borrow() + 1
+   |          ^---------
+   |          |
+   |          borrowed value does not live long enough
+   |          borrow may end up in a temporary, created here
+LL |     }; //~^ ERROR `*a` does not live long enough
+   |     -- temporary later dropped here, potentially using the reference
+   |     |
+   |     borrowed value only lives until here
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr
index e69de29bb2d..56f2d14390e 100644
--- a/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr
+++ b/src/test/ui/span/issue-23338-locals-die-before-temps-of-body.nll.stderr
@@ -0,0 +1,30 @@
+error[E0597]: `y` does not live long enough
+  --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:20:5
+   |
+LL |     y.borrow().clone()
+   |     ^---------
+   |     |
+   |     borrowed value does not live long enough
+   |     borrow may end up in a temporary, created here
+LL | }
+   | -
+   | |
+   | borrowed value only lives until here
+   | temporary later dropped here, potentially using the reference
+
+error[E0597]: `y` does not live long enough
+  --> $DIR/issue-23338-locals-die-before-temps-of-body.rs:27:9
+   |
+LL |         y.borrow().clone()
+   |         ^---------
+   |         |
+   |         borrowed value does not live long enough
+   |         borrow may end up in a temporary, created here
+LL |     };
+   |     -- temporary later dropped here, potentially using the reference
+   |     |
+   |     borrowed value only lives until here
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/span/wf-method-late-bound-regions.nll.stderr b/src/test/ui/span/wf-method-late-bound-regions.nll.stderr
index a175cf1b38a..063ac376b05 100644
--- a/src/test/ui/span/wf-method-late-bound-regions.nll.stderr
+++ b/src/test/ui/span/wf-method-late-bound-regions.nll.stderr
@@ -1,14 +1,14 @@
-error: compilation successful
-  --> $DIR/wf-method-late-bound-regions.rs:25:1
+error[E0597]: `pointer` does not live long enough
+  --> $DIR/wf-method-late-bound-regions.rs:30:18
    |
-LL | / fn main() { #![rustc_error] // rust-lang/rust#49855
-LL | |     let f = Foo(None);
-LL | |     let f2 = f;
-LL | |     let dangling = {
-...  |
-LL | |     println!("{}", dangling);
-LL | | }
-   | |_^
+LL |         f2.xmute(&pointer)
+   |                  ^^^^^^^^ borrowed value does not live long enough
+LL |     };
+   |     - borrowed value only lives until here
+LL |     //~^^ ERROR `pointer` does not live long enough
+LL |     println!("{}", dangling);
+   |                    -------- borrow later used here
 
 error: aborting due to previous error
 
+For more information about this error, try `rustc --explain E0597`.
diff --git a/src/test/ui/span/wf-method-late-bound-regions.rs b/src/test/ui/span/wf-method-late-bound-regions.rs
index 317cd395d0a..d58c29d4a32 100644
--- a/src/test/ui/span/wf-method-late-bound-regions.rs
+++ b/src/test/ui/span/wf-method-late-bound-regions.rs
@@ -11,7 +11,7 @@
 // A method's receiver must be well-formed, even if it has late-bound regions.
 // Because of this, a method's substs being well-formed does not imply that
 // the method's implied bounds are met.
-#![feature(rustc_attrs)]
+
 struct Foo<'b>(Option<&'b ()>);
 
 trait Bar<'b> {
@@ -22,7 +22,7 @@ impl<'b> Bar<'b> for Foo<'b> {
     fn xmute<'a>(&'a self, u: &'b u32) -> &'a u32 { u }
 }
 
-fn main() { #![rustc_error] // rust-lang/rust#49855
+fn main() {
     let f = Foo(None);
     let f2 = f;
     let dangling = {