2019-04-26 16:14:52 -05:00
|
|
|
error[E0597]: `local` does not live long enough
|
|
|
|
--> $DIR/local-outlives-static-via-hrtb.rs:24:28
|
|
|
|
|
|
2023-01-14 21:06:44 -06:00
|
|
|
LL | let local = 0;
|
|
|
|
| ----- binding `local` declared here
|
2019-04-26 16:14:52 -05:00
|
|
|
LL | assert_static_via_hrtb(&local);
|
|
|
|
| -----------------------^^^^^^-
|
|
|
|
| | |
|
|
|
|
| | borrowed value does not live long enough
|
|
|
|
| argument requires that `local` is borrowed for `'static`
|
|
|
|
LL | assert_static_via_hrtb_with_assoc_type(&&local);
|
|
|
|
LL | }
|
|
|
|
| - `local` dropped here while still borrowed
|
2022-09-16 16:43:45 -05:00
|
|
|
|
|
|
|
|
note: due to current limitations in the borrow checker, this implies a `'static` lifetime
|
|
|
|
--> $DIR/local-outlives-static-via-hrtb.rs:15:53
|
|
|
|
|
|
|
|
|
LL | fn assert_static_via_hrtb<G>(_: G) where for<'a> G: Outlives<'a> {}
|
|
|
|
| ^^^^^^^^^^^^
|
2019-04-26 16:14:52 -05:00
|
|
|
|
|
|
|
error[E0597]: `local` does not live long enough
|
|
|
|
--> $DIR/local-outlives-static-via-hrtb.rs:25:45
|
|
|
|
|
|
2023-01-14 21:06:44 -06:00
|
|
|
LL | let local = 0;
|
|
|
|
| ----- binding `local` declared here
|
|
|
|
LL | assert_static_via_hrtb(&local);
|
2019-04-26 16:14:52 -05:00
|
|
|
LL | assert_static_via_hrtb_with_assoc_type(&&local);
|
|
|
|
| ----------------------------------------^^^^^^-
|
|
|
|
| | |
|
|
|
|
| | borrowed value does not live long enough
|
|
|
|
| argument requires that `local` is borrowed for `'static`
|
|
|
|
LL | }
|
|
|
|
| - `local` dropped here while still borrowed
|
2022-09-16 16:43:45 -05:00
|
|
|
|
|
|
|
|
note: due to current limitations in the borrow checker, this implies a `'static` lifetime
|
|
|
|
--> $DIR/local-outlives-static-via-hrtb.rs:19:20
|
|
|
|
|
|
|
|
|
LL | for<'a> &'a T: Reference<AssociatedType = &'a ()>,
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2019-04-26 16:14:52 -05:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0597`.
|