Simplify issue-4291 test
This commit is contained in:
@@ -63,20 +63,12 @@ impl X {
|
|||||||
|
|
||||||
// Methods implementing traits must have matching lifetimes
|
// Methods implementing traits must have matching lifetimes
|
||||||
mod issue4291 {
|
mod issue4291 {
|
||||||
#[derive(Debug)]
|
trait BadTrait {
|
||||||
pub struct Foo<'a>(&'a std::marker::PhantomData<u8>);
|
fn unused_lt<'a>(x: u8) {}
|
||||||
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct Bar<'a: 'b, 'b>(Foo<'a>, &'b std::marker::PhantomData<u8>);
|
|
||||||
|
|
||||||
trait LT {
|
|
||||||
fn test<'a: 'b, 'b>(foo: &Foo<'a>, bar: &Bar<'a, 'b>);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Baz;
|
impl BadTrait for () {
|
||||||
|
fn unused_lt<'a>(_x: u8) {}
|
||||||
impl LT for Baz {
|
|
||||||
fn test<'a: 'b, 'b>(_foo: &Foo, _bar: &Bar) {}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,5 +18,11 @@ error: this lifetime isn't used in the function definition
|
|||||||
LL | fn x<'a>(&self) {}
|
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user