-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mark attributes consumed by
check_mod_attrs
as normal
Take advantage of the fact that `check_mod_attrs` marks attributes as used and change their type to normal, so that any remaining uses will be warned about by the unused attribute lint.
- Loading branch information
Showing
3 changed files
with
63 additions
and
6 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,13 @@ | ||
#![deny(unused_attributes)] | ||
|
||
#![feature(naked_functions)] | ||
#![feature(track_caller)] | ||
|
||
#![used] //~ ERROR unused attribute | ||
#![non_exhaustive] //~ ERROR unused attribute | ||
#![inline] //~ ERROR unused attribute | ||
#![target_feature(enable = "")] //~ ERROR unused attribute | ||
#![naked] //~ ERROR unused attribute | ||
#![track_caller] //~ ERROR unused attribute | ||
|
||
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,44 @@ | ||
error: unused attribute | ||
--> $DIR/unused-attr-crate.rs:6:1 | ||
| | ||
LL | #![used] | ||
| ^^^^^^^^ | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/unused-attr-crate.rs:1:9 | ||
| | ||
LL | #![deny(unused_attributes)] | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: unused attribute | ||
--> $DIR/unused-attr-crate.rs:7:1 | ||
| | ||
LL | #![non_exhaustive] | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
||
error: unused attribute | ||
--> $DIR/unused-attr-crate.rs:8:1 | ||
| | ||
LL | #![inline] | ||
| ^^^^^^^^^^ | ||
|
||
error: unused attribute | ||
--> $DIR/unused-attr-crate.rs:9:1 | ||
| | ||
LL | #![target_feature(enable = "")] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: unused attribute | ||
--> $DIR/unused-attr-crate.rs:10:1 | ||
| | ||
LL | #![naked] | ||
| ^^^^^^^^^ | ||
|
||
error: unused attribute | ||
--> $DIR/unused-attr-crate.rs:11:1 | ||
| | ||
LL | #![track_caller] | ||
| ^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 6 previous errors | ||
|