2021-10-03 17:14:33 -05:00
|
|
|
error[E0597]: `y` does not live long enough
|
2021-11-22 14:14:25 -06:00
|
|
|
--> $DIR/const-expr-lifetime-err.rs:23:30
|
2021-10-03 17:14:33 -05:00
|
|
|
|
|
|
|
|
LL | fn foo<'a>() {
|
|
|
|
| -- lifetime `'a` defined here
|
|
|
|
LL | let y = ();
|
2023-01-14 21:06:44 -06:00
|
|
|
| - binding `y` declared here
|
2021-10-03 17:14:33 -05:00
|
|
|
LL | equate(InvariantRef::new(&y), const { InvariantRef::<'a>::NEW });
|
|
|
|
| ------------------^^-
|
|
|
|
| | |
|
|
|
|
| | borrowed value does not live long enough
|
|
|
|
| argument requires that `y` is borrowed for `'a`
|
|
|
|
LL |
|
|
|
|
LL | }
|
|
|
|
| - `y` dropped here while still borrowed
|
|
|
|
|
2023-11-21 09:44:16 -06:00
|
|
|
error: aborting due to 1 previous error
|
2021-10-03 17:14:33 -05:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|