rust/src/test/ui/dropck/drop-with-active-borrows-2.stderr

19 lines
617 B
Plaintext
Raw Normal View History

2018-08-08 12:28:26 +00:00
error[E0597]: `raw_lines` does not live long enough
2018-12-25 15:56:47 +00:00
--> $DIR/drop-with-active-borrows-2.rs:3:5
2018-08-08 12:28:26 +00:00
|
LL | raw_lines.iter().map(|l| l.trim()).collect()
| ^^^^^^^^^ borrowed value does not live long enough
2019-03-09 12:03:44 +00:00
LL |
2018-08-08 12:28:26 +00:00
LL | }
| - borrowed value only lives until here
|
2018-12-25 15:56:47 +00:00
note: borrowed value must be valid for the lifetime 'a as defined on the function body at 1:24...
--> $DIR/drop-with-active-borrows-2.rs:1:24
2018-08-08 12:28:26 +00:00
|
LL | fn read_lines_borrowed<'a>() -> Vec<&'a str> {
| ^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0597`.