-
Notifications
You must be signed in to change notification settings - Fork 13.6k
make path_statements lint machine applicable for statements with no effect #140830
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,4 +14,12 @@ fn main() { | |
|
||
let z = (Droppy,); | ||
z; //~ ERROR path statement drops value | ||
|
||
macro_rules! foo { | ||
($e:expr) => { | ||
$e; | ||
}; | ||
} | ||
|
||
foo!(x); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jieyouxu is this what you meant? Right now this is emitting the lint. Is the idea that this lint shouldn't be emitted the lint in this case or that it shouldn't be machine applicable? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I somehow completely lost this notification, sorry about that. Now that I read my own comment #140830 (review) back, I think what I had in mind at the time was stuff like having a path statement that comes from a macro expansion from another crate, where I think I thought that a machine-applicable suggestion in that case wouldn't be very actionable. ... But that can be a follow-up or further adjusted as suitable, and does not need to block this PR at 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.
Note: I think you'll need a
annotation here. I guess partly what I had in mind re. macros was also this case, where the suggestion is tied to removing
$e;
, though arguably maybe it's the invocationfoo!(x);
that should be removed.Again, this is not blocking IMO.