// Test that shadowed lifetimes generate an error. struct Foo(T); impl Foo { fn shadow_in_method(&self) {} //~^ ERROR the name `T` is already used fn not_shadow_in_item(&self) { struct Bar(T,U); // not a shadow, separate item fn foo() {} // same } } trait Bar { fn dummy(&self) -> T; fn shadow_in_required(&self); //~^ ERROR the name `T` is already used fn shadow_in_provided(&self) {} //~^ ERROR the name `T` is already used fn not_shadow_in_required(&self); fn not_shadow_in_provided(&self) {} } fn main() {}