-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix false positive for unused_unit #14962
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
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 |
---|---|---|
|
@@ -143,4 +143,10 @@ mod issue14577 { | |
todo!() | ||
} | ||
} | ||
} | ||
} | ||
|
||
mod pr14962 { | ||
#[allow(unused_parens)] | ||
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. Since this is a targeted lint, could you please use 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. This does not actually emit a warning by rustc yet. I'm currently looking into why that is exactly. I can remove the attribute and change the name of the type alias if you want. |
||
type UnusedParensButNoUnit = Box<dyn (Fn())>; | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
Perhaps this should have been covered by
!hir_ty.span.from_expansion()
. Certainly, there are no explicit-> ()
tokens in the source. If this is the case, I'm happy to close this PR and file an issue upstream.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.
Those expansion checks are quite finicky; sometimes you have an expression without expansion but a subexpression expanded, etc. So as long as this appears to fix the issue, it's better than nothing.