Skip to content

Commit 4458bef

Browse files
author
Michael Wright
committed
Simplify issue-4291 test
1 parent 88750f9 commit 4458bef

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

tests/ui/extra_unused_lifetimes.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,12 @@ impl X {
6363

6464
// Methods implementing traits must have matching lifetimes
6565
mod issue4291 {
66-
#[derive(Debug)]
67-
pub struct Foo<'a>(&'a std::marker::PhantomData<u8>);
68-
69-
#[derive(Debug)]
70-
pub struct Bar<'a: 'b, 'b>(Foo<'a>, &'b std::marker::PhantomData<u8>);
71-
72-
trait LT {
73-
fn test<'a: 'b, 'b>(foo: &Foo<'a>, bar: &Bar<'a, 'b>);
66+
trait BadTrait {
67+
fn unused_lt<'a>(x: u8) {}
7468
}
7569

76-
pub struct Baz;
77-
78-
impl LT for Baz {
79-
fn test<'a: 'b, 'b>(_foo: &Foo, _bar: &Bar) {}
70+
impl BadTrait for () {
71+
fn unused_lt<'a>(_x: u8) {}
8072
}
8173
}
8274

tests/ui/extra_unused_lifetimes.stderr

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,11 @@ error: this lifetime isn't used in the function definition
1818
LL | fn x<'a>(&self) {}
1919
| ^^
2020

21-
error: aborting due to 3 previous errors
21+
error: this lifetime isn't used in the function definition
22+
--> $DIR/extra_unused_lifetimes.rs:67:22
23+
|
24+
LL | fn unused_lt<'a>(x: u8) {}
25+
| ^^
26+
27+
error: aborting due to 4 previous errors
2228

0 commit comments

Comments
 (0)