]> git.lizzy.rs Git - rust.git/blob - src/test/ui/regions/regions-addr-of-arg.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / regions / regions-addr-of-arg.stderr
1 error[E0597]: `a` does not live long enough
2   --> $DIR/regions-addr-of-arg.rs:15:31
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    | - borrowed value only lives until here
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:6
13    |
14 LL |     &a //~ ERROR `a` does not live long enough
15    |      ^ borrowed value does not live long enough
16 LL | }
17    | - borrowed value only lives until here
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`.