Skip to content
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

Merged
merged 3 commits into from
Apr 5, 2016
Merged

Autoderef when suggesting to call (self.field) #32712

merged 3 commits into from
Apr 5, 2016

Conversation

jonas-schievink
Copy link
Contributor

Fixes #32128

@rust-highfive
Copy link
Collaborator

r? @nrc

(rust_highfive has picked a reviewer for you, use r? to override)

})
});

match opt_is_fn {
Copy link
Member

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)?

Copy link
Contributor Author

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)
Copy link
Member

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?

Copy link
Contributor Author

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 bools I think :-)

This should be better.

@nagisa
Copy link
Member

nagisa commented Apr 4, 2016

This seems good to me. r=me with nit fixed or well objected to.

@nagisa
Copy link
Member

nagisa commented Apr 4, 2016

@bors r+ 1ea98a8

Manishearth added a commit to Manishearth/rust that referenced this pull request Apr 5, 2016
…r-fn-ty, r=nagisa

Autoderef when suggesting to call `(self.field)`

Fixes rust-lang#32128
bors added a commit that referenced this pull request Apr 5, 2016
Rollup of 11 pull requests

- Successful merges: #32403, #32596, #32675, #32678, #32685, #32686, #32692, #32710, #32712, #32714, #32715
- Failed merges: #32488
@bors bors merged commit 1ea98a8 into rust-lang:master Apr 5, 2016
@jonas-schievink jonas-schievink deleted the autoderef-fields-for-fn-ty branch April 5, 2016 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants