]> git.lizzy.rs Git - rust.git/blob - tests/ui/nll/local-outlives-static-via-hrtb.stderr
Auto merge of #103019 - Kobzol:ci-multistage-python, r=Mark-Simulacrum
[rust.git] / tests / ui / nll / local-outlives-static-via-hrtb.stderr
1 error[E0597]: `local` does not live long enough
2   --> $DIR/local-outlives-static-via-hrtb.rs:24:28
3    |
4 LL |     let local = 0;
5    |         ----- binding `local` declared here
6 LL |     assert_static_via_hrtb(&local);
7    |     -----------------------^^^^^^-
8    |     |                      |
9    |     |                      borrowed value does not live long enough
10    |     argument requires that `local` is borrowed for `'static`
11 LL |     assert_static_via_hrtb_with_assoc_type(&&local);
12 LL | }
13    | - `local` dropped here while still borrowed
14    |
15 note: due to current limitations in the borrow checker, this implies a `'static` lifetime
16   --> $DIR/local-outlives-static-via-hrtb.rs:15:53
17    |
18 LL | fn assert_static_via_hrtb<G>(_: G) where for<'a> G: Outlives<'a> {}
19    |                                                     ^^^^^^^^^^^^
20
21 error[E0597]: `local` does not live long enough
22   --> $DIR/local-outlives-static-via-hrtb.rs:25:45
23    |
24 LL |     let local = 0;
25    |         ----- binding `local` declared here
26 LL |     assert_static_via_hrtb(&local);
27 LL |     assert_static_via_hrtb_with_assoc_type(&&local);
28    |     ----------------------------------------^^^^^^-
29    |     |                                       |
30    |     |                                       borrowed value does not live long enough
31    |     argument requires that `local` is borrowed for `'static`
32 LL | }
33    | - `local` dropped here while still borrowed
34    |
35 note: due to current limitations in the borrow checker, this implies a `'static` lifetime
36   --> $DIR/local-outlives-static-via-hrtb.rs:19:20
37    |
38 LL |     for<'a> &'a T: Reference<AssociatedType = &'a ()>,
39    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40
41 error: aborting due to 2 previous errors
42
43 For more information about this error, try `rustc --explain E0597`.