]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-free-region-ordering-caller1.stderr
Rollup merge of #93112 - pietroalbini:pa-cve-2022-21658-nightly, r=pietroalbini
[rust.git] / src / test / ui / regions / regions-free-region-ordering-caller1.stderr
1 error[E0716]: temporary value dropped while borrowed
2   --> $DIR/regions-free-region-ordering-caller1.rs:9:27
3    |
4 LL | fn call1<'a>(x: &'a usize) {
5    |          -- lifetime `'a` defined here
6 ...
7 LL |     let z: &'a & usize = &(&y);
8    |            -----------    ^^^^ creates a temporary which is freed while still in use
9    |            |
10    |            type annotation requires that borrow lasts for `'a`
11 ...
12 LL | }
13    | - temporary value is freed at the end of this statement
14
15 error[E0597]: `y` does not live long enough
16   --> $DIR/regions-free-region-ordering-caller1.rs:9:27
17    |
18 LL | fn call1<'a>(x: &'a usize) {
19    |          -- lifetime `'a` defined here
20 ...
21 LL |     let z: &'a & usize = &(&y);
22    |            -----------    ^^^^ borrowed value does not live long enough
23    |            |
24    |            type annotation requires that `y` is borrowed for `'a`
25 ...
26 LL | }
27    | - `y` dropped here while still borrowed
28
29 error: aborting due to 2 previous errors
30
31 Some errors have detailed explanations: E0597, E0716.
32 For more information about an error, try `rustc --explain E0597`.