-
Notifications
You must be signed in to change notification settings - Fork 13.4k
save-analysis: fix ICE on partially resolved path #37908
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
Conversation
r? @arielb1 (rust_highfive has picked a reviewer for you, use r? to override) |
r? @eddyb |
Can we have a test for this? There is a large change(#37676) to how we store partial/full resolution in the queue. |
@@ -497,7 +497,7 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> { | |||
} | |||
|
|||
pub fn get_path_data(&self, id: NodeId, path: &ast::Path) -> Option<Data> { | |||
let def = self.tcx.expect_def(id); | |||
let def = option_try!(self.tcx.expect_resolution(id).maybe_full_def()); |
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.
Can you do it here, without adding a method?
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 could, but it would be (IMO) a bit of an abstraction violation - depth
and whether a def is 'baked' or not seem like implementation details that we shouldn't be dealing with here. Plus the method seems like a thing we'd might want - there are similar methods all over the ty ctxt, etc.
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.
The reason I'm saying this is because of #37676 which will catch that case differently here and the post-HIR-lowering compiler in general stops using PathResolution
at all (which was a "temporary" hack I introduced ages ago, and it causes serious issues, even if it may seem more convenient in some cases).
Occurs when we produce save-analysis before type checking is complete (due to errors).
@eddyb change made |
@bors r+ |
📌 Commit b1f86fb has been approved by |
⌛ Testing commit b1f86fb with merge d5814b0... |
save-analysis: fix ICE on partially resolved path Occurs when we produce save-analysis before type checking is complete (due to errors).
Occurs when we produce save-analysis before type checking is complete (due to errors).