]> git.lizzy.rs Git - rust.git/blob - tests/ui/span/vec_refs_data_with_early_death.stderr
Auto merge of #107843 - bjorn3:sync_cg_clif-2023-02-09, r=bjorn3
[rust.git] / tests / ui / span / vec_refs_data_with_early_death.stderr
1 error[E0597]: `x` does not live long enough
2   --> $DIR/vec_refs_data_with_early_death.rs:17:12
3    |
4 LL |     let x: i8 = 3;
5    |         - binding `x` declared here
6 ...
7 LL |     v.push(&x);
8    |            ^^ borrowed value does not live long enough
9 ...
10 LL | }
11    | -
12    | |
13    | `x` dropped here while still borrowed
14    | borrow might be used here, when `v` is dropped and runs the `Drop` code for type `Bag`
15    |
16    = note: values in a scope are dropped in the opposite order they are defined
17
18 error[E0597]: `y` does not live long enough
19   --> $DIR/vec_refs_data_with_early_death.rs:19:12
20    |
21 LL |     let y: i8 = 4;
22    |         - binding `y` declared here
23 ...
24 LL |     v.push(&y);
25    |            ^^ borrowed value does not live long enough
26 ...
27 LL | }
28    | -
29    | |
30    | `y` dropped here while still borrowed
31    | borrow might be used here, when `v` is dropped and runs the `Drop` code for type `Bag`
32    |
33    = note: values in a scope are dropped in the opposite order they are defined
34
35 error: aborting due to 2 previous errors
36
37 For more information about this error, try `rustc --explain E0597`.