1 // Test that shadowed lifetimes generate an error.
3 struct Foo<'a>(&'a isize);
6 fn shadow_in_method<'a>(&'a self) -> &'a isize {
7 //~^ ERROR lifetime name `'a` shadows a lifetime name that is already in scope
11 fn shadow_in_type<'b>(&'b self) -> &'b isize {
12 let x: for<'b> fn(&'b isize) = panic!();
13 //~^ ERROR lifetime name `'b` shadows a lifetime name that is already in scope
17 fn not_shadow_in_item<'b>(&'b self) {
18 struct Bar<'a, 'b>(&'a isize, &'b isize); // not a shadow, separate item
19 fn foo<'a, 'b>(x: &'a isize, y: &'b isize) { } // same