-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Autoderef when suggesting to call (self.field)
#32712
Autoderef when suggesting to call (self.field)
#32712
Conversation
r? @nrc (rust_highfive has picked a reviewer for you, use r? to override) |
}) | ||
}); | ||
|
||
match opt_is_fn { |
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.
opt_is_fn.unwrap_or(false)
?
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.
Gah, of course. Fixed.
let mut selcx = SelectionContext::new(infcx); | ||
|
||
if selcx.evaluate_obligation(&obligation) { | ||
Some(true) |
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.
Nit: I can’t find Some(false)
ever getting emitted. Couldn’t you just return Some(())
and then interpret the discriminant as boolean with .is_some()
instead?
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, sure. I just got caught up in a mess of bool
s I think :-)
This should be better.
This seems good to me. r=me with nit fixed or well objected to. |
…r-fn-ty, r=nagisa Autoderef when suggesting to call `(self.field)` Fixes rust-lang#32128
Fixes #32128