rust/tests/ui/issues/issue-52126-assign-op-invariance.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
619 B
Plaintext
Raw Normal View History

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
|
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();
| ^^^^ borrowed value does not live long enough
2018-07-20 11:12:03 +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`.