]> git.proxmox.com Git - rustc.git/blob - src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-self-is-anon.nll.stderr
New upstream version 1.62.1+dfsg1
[rustc.git] / src / test / ui / lifetimes / lifetime-errors / ex1-return-one-existing-name-self-is-anon.nll.stderr
1 error: lifetime may not live long enough
2 --> $DIR/ex1-return-one-existing-name-self-is-anon.rs:8:30
3 |
4 LL | fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
5 | -- - let's call the lifetime of this reference `'1`
6 | |
7 | lifetime `'a` defined here
8 LL |
9 LL | if true { x } else { self }
10 | ^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
11
12 error: aborting due to previous error
13