]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lifetimes/lifetime-errors/ex3-both-anon-regions-return-type-is-anon.nll.stderr
Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJung
[rust.git] / src / test / ui / lifetimes / lifetime-errors / ex3-both-anon-regions-return-type-is-anon.nll.stderr
1 error: lifetime may not live long enough
2   --> $DIR/ex3-both-anon-regions-return-type-is-anon.rs:7:5
3    |
4 LL |   fn foo<'a>(&self, x: &i32) -> &i32 {
5    |              -         - let's call the lifetime of this reference `'1`
6    |              |
7    |              let's call the lifetime of this reference `'2`
8 LL |     x
9    |     ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
10
11 error: aborting due to previous error
12