]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/nll/borrowed-universal-error.stderr
Update upstream source from tag 'upstream/1.31.0_beta.4+dfsg1'
[rustc.git] / src / test / ui / nll / borrowed-universal-error.stderr
index da287980e8c5f49356907b1ae831af77ca2dbfab..a5b3e6bcf35010d2a08a18ff276c1956b8403989 100644 (file)
@@ -1,18 +1,12 @@
-error[E0597]: borrowed value does not live long enough
-  --> $DIR/borrowed-universal-error.rs:20:12
+error[E0515]: cannot return value referencing temporary value
+  --> $DIR/borrowed-universal-error.rs:20:5
    |
 LL |     gimme(&(v,))
-   |            ^^^^ temporary value does not live long enough
-LL |     //~^ ERROR borrowed value does not live long enough [E0597]
-LL | }
-   | - temporary value only lives until here
-   |
-note: borrowed value must be valid for the lifetime 'a as defined on the function body at 18:8...
-  --> $DIR/borrowed-universal-error.rs:18:8
-   |
-LL | fn foo<'a>(x: &'a (u32,)) -> &'a u32 {
-   |        ^^
+   |     ^^^^^^^----^
+   |     |      |
+   |     |      temporary value created here
+   |     returns a value referencing data owned by the current function
 
 error: aborting due to previous error
 
-For more information about this error, try `rustc --explain E0597`.
+For more information about this error, try `rustc --explain E0515`.