mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
29 lines
1.0 KiB
Plaintext
29 lines
1.0 KiB
Plaintext
error[E0597]: `y` does not live long enough
|
|
--> $DIR/const-match-pat-lifetime-err.rs:28:29
|
|
|
|
|
LL | fn match_invariant_ref<'a>() {
|
|
| -- lifetime `'a` defined here
|
|
LL | let y = ();
|
|
| - binding `y` declared here
|
|
LL | match InvariantRef::new(&y) {
|
|
| ^^ borrowed value does not live long enough
|
|
LL |
|
|
LL | const { InvariantRef::<'a>::NEW } => (),
|
|
| --------------------------------- type annotation requires that `y` is borrowed for `'a`
|
|
LL | }
|
|
LL | }
|
|
| - `y` dropped here while still borrowed
|
|
|
|
error: lifetime may not live long enough
|
|
--> $DIR/const-match-pat-lifetime-err.rs:38:12
|
|
|
|
|
LL | fn match_covariant_ref<'a>() {
|
|
| -- lifetime `'a` defined here
|
|
...
|
|
LL | let y: (CovariantRef<'static, _>,) = (CovariantRef(&()),);
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|