]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/local-outlives-static-via-hrtb.stderr
Rollup merge of #103644 - catlee:catlee/option-question-mark-docs, r=workingjubilee
[rust.git] / src / test / 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 |     assert_static_via_hrtb(&local);
5    |     -----------------------^^^^^^-
6    |     |                      |
7    |     |                      borrowed value does not live long enough
8    |     argument requires that `local` is borrowed for `'static`
9 LL |     assert_static_via_hrtb_with_assoc_type(&&local);
10 LL | }
11    | - `local` dropped here while still borrowed
12    |
13 note: due to current limitations in the borrow checker, this implies a `'static` lifetime
14   --> $DIR/local-outlives-static-via-hrtb.rs:15:53
15    |
16 LL | fn assert_static_via_hrtb<G>(_: G) where for<'a> G: Outlives<'a> {}
17    |                                                     ^^^^^^^^^^^^
18
19 error[E0597]: `local` does not live long enough
20   --> $DIR/local-outlives-static-via-hrtb.rs:25:45
21    |
22 LL |     assert_static_via_hrtb_with_assoc_type(&&local);
23    |     ----------------------------------------^^^^^^-
24    |     |                                       |
25    |     |                                       borrowed value does not live long enough
26    |     argument requires that `local` is borrowed for `'static`
27 LL | }
28    | - `local` dropped here while still borrowed
29    |
30 note: due to current limitations in the borrow checker, this implies a `'static` lifetime
31   --> $DIR/local-outlives-static-via-hrtb.rs:19:20
32    |
33 LL |     for<'a> &'a T: Reference<AssociatedType = &'a ()>,
34    |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
35
36 error: aborting due to 2 previous errors
37
38 For more information about this error, try `rustc --explain E0597`.