diff --git a/tests/ui/extra_unused_lifetimes.rs b/tests/ui/extra_unused_lifetimes.rs index 66f6e67a75c..ba95fd63bf9 100644 --- a/tests/ui/extra_unused_lifetimes.rs +++ b/tests/ui/extra_unused_lifetimes.rs @@ -63,20 +63,12 @@ impl X { // Methods implementing traits must have matching lifetimes mod issue4291 { - #[derive(Debug)] - pub struct Foo<'a>(&'a std::marker::PhantomData); - - #[derive(Debug)] - pub struct Bar<'a: 'b, 'b>(Foo<'a>, &'b std::marker::PhantomData); - - trait LT { - fn test<'a: 'b, 'b>(foo: &Foo<'a>, bar: &Bar<'a, 'b>); + trait BadTrait { + fn unused_lt<'a>(x: u8) {} } - pub struct Baz; - - impl LT for Baz { - fn test<'a: 'b, 'b>(_foo: &Foo, _bar: &Bar) {} + impl BadTrait for () { + fn unused_lt<'a>(_x: u8) {} } } diff --git a/tests/ui/extra_unused_lifetimes.stderr b/tests/ui/extra_unused_lifetimes.stderr index 6473a2fbcb2..ebdb8e74952 100644 --- a/tests/ui/extra_unused_lifetimes.stderr +++ b/tests/ui/extra_unused_lifetimes.stderr @@ -18,5 +18,11 @@ error: this lifetime isn't used in the function definition LL | fn x<'a>(&self) {} | ^^ -error: aborting due to 3 previous errors +error: this lifetime isn't used in the function definition + --> $DIR/extra_unused_lifetimes.rs:67:22 + | +LL | fn unused_lt<'a>(x: u8) {} + | ^^ + +error: aborting due to 4 previous errors