make path_statements lint machine applicable for statements with no effect#140830
make path_statements lint machine applicable for statements with no effect#140830yaahc wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
r? @nnethercote rustbot has assigned @nnethercote. Use |
|
@rustbot author |
4096867 to
ba2de32
Compare
|
ba2de32 to
6ababd0
Compare
| }; | ||
| } | ||
|
|
||
| foo!(x); |
There was a problem hiding this comment.
@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.
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.
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
@rustbot ready |
|
r? @jieyouxu |
|
Requested reviewer is already assigned to this pull request. Please choose another assignee. |
|
|
||
| macro_rules! foo { | ||
| ($e:expr) => { | ||
| $e; |
There was a problem hiding this comment.
Note: I think you'll need a
//~^ ERROR: path statement with no effect
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 invocation foo!(x); that should be removed.
Again, this is not blocking IMO.
|
Sorry about losing the notification, I just had some thoughts on the suggestion which are not blocking. Feel free to r=me after adding the missing error annotation. @rustbot author |
|
☔ The latest upstream changes (presumably #144469) made this pull request unmergeable. Please resolve the merge conflicts. |
The motivation for this change is to make it easier to clean up code generated by c2rust, which tends to include a lot of unnecessary path statements.