fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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