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#81556 - nikomatsakis:forbidden-lint-groups-…
…lint, r=pnkfelix introduce future-compatibility warning for forbidden lint groups We used to ignore `forbid(group)` scenarios completely. This changed in rust-lang#78864, but that led to a number of regressions (rust-lang#80988, rust-lang#81218). This PR introduces a future compatibility warning for the case where a group is forbidden but then an individual lint within that group is allowed. We now issue a FCW when we see the "allow", but permit it to take effect. r? ```@Mark-Simulacrum```
- Loading branch information
Showing
19 changed files
with
554 additions
and
54 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
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
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,13 @@ | ||
// Check what happens when we forbid a smaller group but | ||
// then allow a superset of that group. | ||
|
||
#![forbid(nonstandard_style)] | ||
|
||
// FIXME: Arguably this should be an error, but the WARNINGS group is | ||
// treated in a very special (and rather ad-hoc) way and | ||
// it fails to trigger. | ||
#[allow(warnings)] | ||
fn main() { | ||
let A: (); | ||
//~^ ERROR should have a snake case name | ||
} |
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,15 @@ | ||
error: variable `A` should have a snake case name | ||
--> $DIR/forbid-group-group-1.rs:11:9 | ||
| | ||
LL | let A: (); | ||
| ^ help: convert the identifier to snake case: `a` | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/forbid-group-group-1.rs:4:11 | ||
| | ||
LL | #![forbid(nonstandard_style)] | ||
| ^^^^^^^^^^^^^^^^^ | ||
= note: `#[forbid(non_snake_case)]` implied by `#[forbid(nonstandard_style)]` | ||
|
||
error: aborting due to previous error | ||
|
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,26 @@ | ||
// Check what happens when we forbid a bigger group but | ||
// then deny a subset of that group. | ||
|
||
#![forbid(warnings)] | ||
#![deny(forbidden_lint_groups)] | ||
|
||
#[allow(nonstandard_style)] | ||
//~^ ERROR incompatible with previous | ||
//~| WARNING previously accepted by the compiler | ||
//~| ERROR incompatible with previous | ||
//~| WARNING previously accepted by the compiler | ||
//~| ERROR incompatible with previous | ||
//~| WARNING previously accepted by the compiler | ||
//~| ERROR incompatible with previous | ||
//~| WARNING previously accepted by the compiler | ||
//~| ERROR incompatible with previous | ||
//~| WARNING previously accepted by the compiler | ||
//~| ERROR incompatible with previous | ||
//~| WARNING previously accepted by the compiler | ||
//~| ERROR incompatible with previous | ||
//~| WARNING previously accepted by the compiler | ||
//~| ERROR incompatible with previous | ||
//~| WARNING previously accepted by the compiler | ||
//~| ERROR incompatible with previous | ||
//~| WARNING previously accepted by the compiler | ||
fn main() {} |
Oops, something went wrong.