]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-58053.stderr
Auto merge of #103600 - compiler-errors:early-binder-nits, r=spastorino
[rust.git] / src / test / ui / nll / issue-58053.stderr
1 error: lifetime may not live long enough
2   --> $DIR/issue-58053.rs:4:33
3    |
4 LL |     let f = |x: &i32| -> &i32 { x };
5    |                 -        -      ^ returning this value requires that `'1` must outlive `'2`
6    |                 |        |
7    |                 |        let's call the lifetime of this reference `'2`
8    |                 let's call the lifetime of this reference `'1`
9
10 error: lifetime may not live long enough
11   --> $DIR/issue-58053.rs:8:25
12    |
13 LL |     let g = |x: &i32| { x };
14    |                 -   -   ^ returning this value requires that `'1` must outlive `'2`
15    |                 |   |
16    |                 |   return type of closure is &'2 i32
17    |                 let's call the lifetime of this reference `'1`
18
19 error: aborting due to 2 previous errors
20