]> git.proxmox.com Git - rustc.git/blobdiff - src/test/ui/dropck/drop-with-active-borrows-2.nll.stderr
New upstream version 1.31.0~beta.4+dfsg1
[rustc.git] / src / test / ui / dropck / drop-with-active-borrows-2.nll.stderr
index 4f792a9c9d28f5635ba68f03dba751bc60590232..6200ec3722cbf88159f6d415c2c9900b0702d9e5 100644 (file)
@@ -1,18 +1,12 @@
-error[E0597]: `raw_lines` does not live long enough
+error[E0515]: cannot return value referencing local variable `raw_lines`
   --> $DIR/drop-with-active-borrows-2.rs:13:5
    |
 LL |     raw_lines.iter().map(|l| l.trim()).collect()
-   |     ^^^^^^^^^ borrowed value does not live long enough
-LL |     //~^ ERROR `raw_lines` does not live long enough
-LL | }
-   | - `raw_lines` dropped here while still borrowed
-   |
-note: borrowed value must be valid for the lifetime 'a as defined on the function body at 11:24...
-  --> $DIR/drop-with-active-borrows-2.rs:11:24
-   |
-LL | fn read_lines_borrowed<'a>() -> Vec<&'a str> {
-   |                        ^^
+   |     ---------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |     |
+   |     returns a value referencing data owned by the current function
+   |     `raw_lines` is borrowed here
 
 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`.