-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Elaborate trait obligations when typechecking impls #43786
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @pnkfelix (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
r? @aturon |
src/librustc/ty/wf.rs
Outdated
@@ -156,7 +175,7 @@ impl<'a, 'gcx, 'tcx> WfPredicates<'a, 'gcx, 'tcx> { | |||
// WF and (b) the trait-ref holds. (It may also be | |||
// normalizable and be WF that way.) | |||
let trait_ref = data.trait_ref(self.infcx.tcx); | |||
self.compute_trait_ref(&trait_ref); | |||
self.compute_trait_ref(&trait_ref, Elaborate::All); |
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.
I guess we could just have Elaborate::None
here, since the implied obligations are proved once and for all when typechecking the impl declaration.
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.
Presumably .. yes ..? Should we change this then?
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 we should change this (I'll let you do that :) )
friendly ping @aturon ! |
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.
Ok, will do that soon. |
@scalexm just did it =) maybe check over what I wrote and see if you agree |
(I wanted to write out the argument to see if I really understood it ;) |
Yes I think it's good :) |
@scalexm should we change this do you think ? #43786 (comment) |
@nikomatsakis yes I think we should change to |
@scalexm ok, care to push a change? want me to do it? |
@bors r+ |
📌 Commit 68fd322 has been approved by |
Elaborate trait obligations when typechecking impls When typechecking trait impl declarations, we only checked that bounds explictly written on the trait declaration hold. We now also check that bounds which would have been implied by the trait reference do hold. Fixes #43784.
☀️ Test successful - status-appveyor, status-travis |
When typechecking trait impl declarations, we only checked that bounds explictly written on the trait declaration hold.
We now also check that bounds which would have been implied by the trait reference do hold.
Fixes #43784.