-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Implement a lint to warn about unused macro rules #96150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3d43be3
Add unused_macro_rules lint definition
est31 0bd2232
Implement the unused_macro_rules lint
est31 5646e9a
Allow unused rules in some places in the compiler, library and tools
est31 d76a939
Add tests
est31 3989f02
Allow unused rules in the testsuite where the lint triggers
est31 493af0b
Also allow unused macro rules in stdarch
est31 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -4,7 +4,6 @@ version = "0.0.0" | |
edition = "2021" | ||
|
||
[lib] | ||
test = false | ||
doctest = false | ||
|
||
[dependencies] | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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,40 @@ | ||
use super::ordinalize; | ||
|
||
#[test] | ||
fn test_ordinalize() { | ||
assert_eq!(ordinalize(1), "1st"); | ||
assert_eq!(ordinalize(2), "2nd"); | ||
assert_eq!(ordinalize(3), "3rd"); | ||
assert_eq!(ordinalize(4), "4th"); | ||
assert_eq!(ordinalize(5), "5th"); | ||
// ... | ||
assert_eq!(ordinalize(10), "10th"); | ||
assert_eq!(ordinalize(11), "11th"); | ||
assert_eq!(ordinalize(12), "12th"); | ||
assert_eq!(ordinalize(13), "13th"); | ||
assert_eq!(ordinalize(14), "14th"); | ||
// ... | ||
assert_eq!(ordinalize(20), "20th"); | ||
assert_eq!(ordinalize(21), "21st"); | ||
assert_eq!(ordinalize(22), "22nd"); | ||
assert_eq!(ordinalize(23), "23rd"); | ||
assert_eq!(ordinalize(24), "24th"); | ||
// ... | ||
assert_eq!(ordinalize(30), "30th"); | ||
assert_eq!(ordinalize(31), "31st"); | ||
assert_eq!(ordinalize(32), "32nd"); | ||
assert_eq!(ordinalize(33), "33rd"); | ||
assert_eq!(ordinalize(34), "34th"); | ||
// ... | ||
assert_eq!(ordinalize(7010), "7010th"); | ||
assert_eq!(ordinalize(7011), "7011th"); | ||
assert_eq!(ordinalize(7012), "7012th"); | ||
assert_eq!(ordinalize(7013), "7013th"); | ||
assert_eq!(ordinalize(7014), "7014th"); | ||
// ... | ||
assert_eq!(ordinalize(7020), "7020th"); | ||
assert_eq!(ordinalize(7021), "7021st"); | ||
assert_eq!(ordinalize(7022), "7022nd"); | ||
assert_eq!(ordinalize(7023), "7023rd"); | ||
assert_eq!(ordinalize(7024), "7024th"); | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.