Skip to content

Commit 6619fc7

Browse files
authored
Unrolled build for rust-lang#122251
Rollup merge of rust-lang#122251 - jieyouxu:unused-lifetimes-dedup-test, r=Nadrieril Add test to check unused_lifetimes don't duplicate "parameter is never used" error Closes rust-lang#72587.
2 parents 3521a2f + ff1459a commit 6619fc7

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

tests/ui/single-use-lifetime/dedup.rs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Check that `unused_lifetimes` lint doesn't duplicate a "parameter is never used" error.
2+
// Fixed in <https://github.com/rust-lang/rust/pull/96833>.
3+
// Issue: <https://github.com/rust-lang/rust/issues/72587>.
4+
5+
#![warn(unused_lifetimes)]
6+
struct Foo<'a>;
7+
//~^ ERROR parameter `'a` is never used
8+
9+
fn main() {}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0392]: lifetime parameter `'a` is never used
2+
--> $DIR/dedup.rs:6:12
3+
|
4+
LL | struct Foo<'a>;
5+
| ^^ unused lifetime parameter
6+
|
7+
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData`
8+
9+
error: aborting due to 1 previous error
10+
11+
For more information about this error, try `rustc --explain E0392`.

0 commit comments

Comments
 (0)