-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Fix unused_parens false positive #143698
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
Fix unused_parens false positive #143698
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//@ check-pass | ||
|
||
#![deny(unused_parens)] | ||
#![allow(warnings)] | ||
trait MyTrait {} | ||
|
||
fn foo(_: Box<dyn FnMut(&mut u32) -> &mut (dyn MyTrait) + Send + Sync>) {} | ||
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. How does this behave with 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've added that case to the test: We continue to emit a warning. |
||
|
||
fn main() {} |
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.
in a sense we want tis to be
constraint
=own_constraint.max(NoBoundsException::OneBound)
where asNoBoundsException::OneBound
is currently the minimal value this is correct?I would feel safer if we were to make this a match on
own_constraint
or add aNoBoundsException.merge
function or sth 🤔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.
Correct.
I see where you're coming from. I went with the match because 1) I don't see this sprawling and 2) the
Option
makes the alternatives a bit "messy". Happy to take this any other direction though. 🙂