-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #82620 - jyn514:apply-renamed-lints, r=Manishearth
Apply lint restrictions from renamed lints Previously, if you denied the old name of a renamed lint, it would warn about using the new name, but otherwise do nothing. Now, it will behave the same as if you'd used the new name. Fixes #82615. r? `@ehuss`
- Loading branch information
Showing
3 changed files
with
62 additions
and
8 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
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 @@ | ||
// compile-flags: --crate-type lib | ||
#![deny(single_use_lifetime)] | ||
//~^ WARNING renamed | ||
//~| NOTE `#[warn(renamed_and_removed_lints)]` on by default | ||
//~| NOTE defined here | ||
fn _foo<'a>(_x: &'a u32) {} | ||
//~^ ERROR only used once | ||
//~| NOTE this lifetime | ||
//~| NOTE is used only here |
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,28 @@ | ||
warning: lint `single_use_lifetime` has been renamed to `single_use_lifetimes` | ||
--> $DIR/renamed-lints-still-apply.rs:2:9 | ||
| | ||
LL | #![deny(single_use_lifetime)] | ||
| ^^^^^^^^^^^^^^^^^^^ help: use the new name: `single_use_lifetimes` | ||
| | ||
= note: `#[warn(renamed_and_removed_lints)]` on by default | ||
|
||
error: lifetime parameter `'a` only used once | ||
--> $DIR/renamed-lints-still-apply.rs:6:9 | ||
| | ||
LL | fn _foo<'a>(_x: &'a u32) {} | ||
| ^^ -- ...is used only here | ||
| | | ||
| this lifetime... | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/renamed-lints-still-apply.rs:2:9 | ||
| | ||
LL | #![deny(single_use_lifetime)] | ||
| ^^^^^^^^^^^^^^^^^^^ | ||
help: elide the single-use lifetime | ||
| | ||
LL | fn _foo(_x: &u32) {} | ||
| -- -- | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|