File tree Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Expand file tree Collapse file tree 2 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -63,20 +63,12 @@ impl X {
63
63
64
64
// Methods implementing traits must have matching lifetimes
65
65
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 ) { }
74
68
}
75
69
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 ) { }
80
72
}
81
73
}
82
74
Original file line number Diff line number Diff line change @@ -18,5 +18,11 @@ error: this lifetime isn't used in the function definition
18
18
LL | fn x<'a>(&self) {}
19
19
| ^^
20
20
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
22
28
You can’t perform that action at this time.
0 commit comments