-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
203: Rustc: Create `Adapter` early to register lints with rustc r=NathanFrasier a=xFrednet Registering the lints early, makes rustc track the lint level correctly (Assuming that marker is registered as a tool) Not much more to say, I wrote this thing last night and I was super tired at the end. But it works, that's the important part ^^ --- Closes: #200 Co-authored-by: xFrednet <[email protected]>
- Loading branch information
Showing
10 changed files
with
189 additions
and
49 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
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,10 @@ | ||
#![feature(register_tool)] | ||
#![register_tool(marker)] | ||
|
||
const FIND_ME_DEFAULT: i32 = 0; | ||
|
||
#[allow(marker::item_with_test_name)] | ||
const FIND_ME_ALLOW: i32 = 0; | ||
|
||
#[deny(marker::item_with_test_name)] | ||
const FIND_ME_DENY: i32 = 0; |
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,22 @@ | ||
warning: found a `const` item with a test name | ||
--> $DIR/lint_level_attributes.rs:4:1 | ||
| | ||
4 | const FIND_ME_DEFAULT: i32 = 0; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: `#[warn(marker::item_with_test_name)]` on by default | ||
|
||
error: found a `const` item with a test name | ||
--> $DIR/lint_level_attributes.rs:10:1 | ||
| | ||
10 | const FIND_ME_DENY: i32 = 0; | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/lint_level_attributes.rs:9:8 | ||
| | ||
9 | #[deny(marker::item_with_test_name)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to previous error; 1 warning emitted | ||
|