2018-07-20 11:12:03 +00:00
|
|
|
error[E0597]: `line` does not live long enough
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/issue-52126-assign-op-invariance.rs:34:28
|
2018-07-20 11:12:03 +00:00
|
|
|
|
|
2023-01-17 02:52:43 +00:00
|
|
|
LL | for line in vec!["123456789".to_string(), "12345678".to_string()] {
|
|
|
|
| ---- binding `line` declared here
|
2018-07-20 11:12:03 +00:00
|
|
|
LL | let v: Vec<&str> = line.split_whitespace().collect();
|
2023-06-22 20:30:23 +00:00
|
|
|
| ^^^^ borrowed value does not live long enough
|
2018-07-20 11:12:03 +00:00
|
|
|
...
|
2019-04-22 07:40:08 +00:00
|
|
|
LL | acc += cnt2;
|
|
|
|
| --- borrow later used here
|
|
|
|
...
|
2018-07-20 11:12:03 +00:00
|
|
|
LL | }
|
|
|
|
| - `line` dropped here while still borrowed
|
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|