]> git.proxmox.com Git - rustc.git/blob - tests/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-if-else-using-impl-3.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / lifetimes / lifetime-errors / ex1-return-one-existing-name-if-else-using-impl-3.rs
1 struct Foo {
2 field: i32
3 }
4
5 impl Foo {
6 fn foo<'a>(&'a self, x: &i32) -> &i32 {
7
8 if true { &self.field } else { x } //~ ERROR explicit lifetime
9
10 }
11
12 }
13
14 fn main() { }