Uh oh!
There was an error while loading. Please reload this page.
Turn trans_fulfill_obligation into a query - #44967
Conversation
rust-highfive
commented
Oct 2, 2017
(rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
I changed this to take a DefId instead of a Span because it looked like all of the other queries used DefId and not Spans. However, there were two places where DUMMY_SP was passed in. I changed those to use DefIds that seemed appropriate but I'm not sure. I'll indicate those below.
If that wasn't the right thing to do, I can revert it.
There was a problem hiding this comment.
Hm, @nikomatsakis would know more about how the span here is actually used.
There was a problem hiding this comment.
This was the first place DUMMY_SP was passed in.
There was a problem hiding this comment.
The enum discriminant also needs to be hashed:
mem::discriminant(self).hash_stable(hcx, hasher);
There was a problem hiding this comment.
So what we usually do here is use an exhaustive destructuring let statement, so in case a field gets added or removed, we don't miss updating the HashStable implementation:
let traits::VtableImplData{
impl_def_id,
substs,ref nested,} = *self;
impl_def_id.hash_stable(hcx, hasher);
substs.hash_stable(hcx, hasher);
nested.hash_stable(hcx, hasher);That means a bit more typing but has proven to be very useful in catching oversights.
michaelwoerister
commented
Oct 2, 2017
Very nice, thank you, @wesleywiser! Please update the I'll let @nikomatsakis do the rest of the review since trait selection is his field. |
arielb1
commented
Oct 2, 2017
r? @arielb1 I think you should just not pass the span/defid. It's just used for error reporting, and passing the span around as the query key will prevent all caching. |
nikomatsakis
commented
Oct 3, 2017
I agree with @arielb1 -- the query key should just be |
There was a problem hiding this comment.
here you can use ObligationCause::dummy() instead
There was a problem hiding this comment.
I actually think this case .. hmm .. maybe cannot occur? That is, @arielb1, would that code you added that causes compilation to abort when types get too large perhaps kick in first?
bors
commented
Oct 3, 2017
☔ The latest upstream changes (presumably #44896) made this pull request unmergeable. Please resolve the merge conflicts. |
There was a problem hiding this comment.
What should I do about this span here? Pass DUMMY_SP?
There was a problem hiding this comment.
Just do a bug! I think. I think for better error reporting we should just dump the query stack during each ICE.
dbddd4e to
a9862b0Comparewesleywiser
commented
Oct 6, 2017
I believe I've resolved all of the review feedback. |
There was a problem hiding this comment.
Should this be forcing fulfull_obligation instead?
There was a problem hiding this comment.
Fixed by making it a bug. I don't know how we'd recreate the query key so that seems appropriate to me, but I'm not 100% sure.
a9862b0 to
31f4b57Compare
nikomatsakis
left a comment
There was a problem hiding this comment.
So this looks right to me. The only question in my mind is if the one case -- which used to be a span_fatal and is now a bug! is truly a bug. If not, I suspect that we should convert the query to yield a Result or Option or something, and let the caller report the problem.
nikomatsakis
commented
Oct 9, 2017
@bors r+ |
bors
commented
Oct 9, 2017
📌 Commit 31f4b57 has been approved by |
bors
commented
Oct 10, 2017
⌛ Testing commit 31f4b57 with merge bf27afeb1a9cf122bd5b2cdfbc765e7f02840119... |
bors
commented
Oct 10, 2017
💔 Test failed - status-travis |
wesleywiser
commented
Oct 11, 2017
Android builder failed. Seems related to some kind of network issue?
|
kennytm
commented
Oct 11, 2017
@bors retry
|
bors
commented
Oct 11, 2017
⌛ Testing commit 31f4b57 with merge 58bb6295629d03131e13923d939ef1401efb4451... |
bors
commented
Oct 12, 2017
💔 Test failed - status-travis |
wesleywiser
commented
Oct 12, 2017
Not sure what this means:
|
kennytm
commented
Oct 12, 2017
@bors retry LLDB segfault. |
bors
commented
Oct 12, 2017
…tsakis Turn `trans_fulfill_obligation` into a query Part of #44891
bors
commented
Oct 12, 2017
☀️ Test successful - status-appveyor, status-travis |
Part of #44891