rust/tests/ui/nll/do-not-ignore-lifetime-bounds-in-copy.stderr

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

17 lines
533 B
Plaintext
Raw Normal View History

2018-08-08 12:28:26 +00:00
error[E0597]: `s` does not live long enough
2019-09-06 14:23:00 +00:00
--> $DIR/do-not-ignore-lifetime-bounds-in-copy.rs:8:17
2018-08-08 12:28:26 +00:00
|
2023-01-15 03:06:44 +00:00
LL | let s = 2;
| - binding `s` declared here
2019-03-09 12:03:44 +00:00
LL | let a = Foo(&s);
2018-08-08 12:28:26 +00:00
| ^^ borrowed value does not live long enough
LL | drop(a);
| - copying this value requires that `s` is borrowed for `'static`
LL | drop(a);
2018-08-08 12:28:26 +00:00
LL | }
| - `s` dropped here while still borrowed
error: aborting due to previous error
For more information about this error, try `rustc --explain E0597`.