mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 00:03:43 +00:00
Simplify issue-4291 test
This commit is contained in:
parent
88750f9ad7
commit
4458bef5d1
@ -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<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>);
|
||||
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) {}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user