]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-addr-of-arg.nll.stderr
Rollup merge of #53317 - estebank:abolish-ice, r=oli-obk
[rust.git] / src / test / ui / regions / regions-addr-of-arg.nll.stderr
1 error[E0597]: `a` does not live long enough
2   --> $DIR/regions-addr-of-arg.rs:15:30
3    |
4 LL |     let _p: &'static isize = &a; //~ ERROR `a` does not live long enough
5    |                              ^^ borrowed value does not live long enough
6 LL | }
7    |  - `a` dropped here while still borrowed
8    |
9    = note: borrowed value must be valid for the static lifetime...
10
11 error[E0597]: `a` does not live long enough
12   --> $DIR/regions-addr-of-arg.rs:23:5
13    |
14 LL |     &a //~ ERROR `a` does not live long enough
15    |     ^^ borrowed value does not live long enough
16 LL | }
17    |  - `a` dropped here while still borrowed
18    |
19 note: borrowed value must be valid for the lifetime 'a as defined on the function body at 22:8...
20   --> $DIR/regions-addr-of-arg.rs:22:8
21    |
22 LL | fn zed<'a>(a: isize) -> &'a isize {
23    |        ^^
24
25 error: aborting due to 2 previous errors
26
27 For more information about this error, try `rustc --explain E0597`.