forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#122251 - jieyouxu:unused-lifetimes-dedup-te…
…st, r=Nadrieril Add test to check unused_lifetimes don't duplicate "parameter is never used" error Closes rust-lang#72587.
- Loading branch information
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Check that `unused_lifetimes` lint doesn't duplicate a "parameter is never used" error. | ||
// Fixed in <https://github.com/rust-lang/rust/pull/96833>. | ||
// Issue: <https://github.com/rust-lang/rust/issues/72587>. | ||
|
||
#![warn(unused_lifetimes)] | ||
struct Foo<'a>; | ||
//~^ ERROR parameter `'a` is never used | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0392]: lifetime parameter `'a` is never used | ||
--> $DIR/dedup.rs:6:12 | ||
| | ||
LL | struct Foo<'a>; | ||
| ^^ unused lifetime parameter | ||
| | ||
= help: consider removing `'a`, referring to it in a field, or using a marker such as `PhantomData` | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0392`. |