-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add #[allow(clippy::*)] to the top-level items in codegen.rs #1207
Merged
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
e19306c
add #[allow(clippy::*)] in the top-level items
T5uku5hi 2230548
fixed conflict
T5uku5hi d3a5234
comment out the all #[allow(clippy::*)] lines
T5uku5hi 51f7756
add #[allow(clippy::*)] to 901 line
T5uku5hi fb8e158
remove unnecessary changes
T5uku5hi 1b76410
Merge remote-tracking branch 'upstream/master' into add-allow-clippy
T5uku5hi 9167893
add #[allow(clippy::drop_ref)]
T5uku5hi 5c0da88
add #[allow(clippy::all)] in top-level items.
T5uku5hi 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 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see -- we should only add
#[allow(clippy::*)]
to things that are top-level items in the expanded code, not anything that is at the top of aquote!
macro invocation, since it might take multiple quotes to build up a top-level item that we are emitting.A good rule of thumb is that we should add it on each
fn
we define.Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes!! I understand you said.
I tried to add
#[allow(clippy::*)]
to things that are top-level items at first,but this code occurred another error like this.
I found that I should use
#[allow(clippy::drop_ref)]
instead of#[allow(clippy::*)]
when I read codes written by others 🧐💡Finally, I fixed it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@T5uku5hi, did you try
#![allow(clippy::all)]
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@limira
Oh! I didn't try
all
instead of*
.I tried it just now and I well did it!
I'll add
#[allow(clippy::all)]
in all the top-level items.Thank you for your kindness 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is my bad, sorry!
For some reason I thought the syntax was
allow(clippy::*)
and it is actuallyallow(clippy::all)
as @limira points out. Sorry about that!