rust/tests/ui/error-codes/E0597.stderr

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

20 lines
580 B
Plaintext
Raw Normal View History

2018-02-08 11:35:35 +08:00
error[E0597]: `y` does not live long enough
--> $DIR/E0597.rs:8:16
2018-02-08 11:35:35 +08:00
|
2023-01-15 11:06:44 +08:00
LL | let y = 0;
| - binding `y` declared here
2018-02-23 08:42:32 +08:00
LL | x.x = Some(&y);
| ^^ borrowed value does not live long enough
2019-03-09 20:03:44 +08:00
LL |
2018-02-23 08:42:32 +08:00
LL | }
| -
| |
| `y` dropped here while still borrowed
| borrow might be used here, when `x` is dropped and runs the `Drop` code for type `Foo`
2018-02-08 11:35:35 +08:00
|
= note: values in a scope are dropped in the opposite order they are defined
2018-02-08 11:35:35 +08:00
error: aborting due to 1 previous error
2018-02-08 11:35:35 +08:00
2018-03-03 22:59:40 +08:00
For more information about this error, try `rustc --explain E0597`.