summaryrefslogtreecommitdiffstats
path: root/src/test/ui/lifetimes/lifetime-errors/ex1-return-one-existing-name-return-type-is-anon.rs
blob: 49993aca3cadd78e5af536e633dd4219b6004e21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
struct Foo {
  field: i32
}

impl Foo {
  fn foo<'a>(&self, x: &'a i32) -> &i32 {

    x
    //~^ ERROR lifetime may not live long enough

  }

}

fn main() { }