Skip to content

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

Merged
merged 4 commits into from
Nov 23, 2016
Merged

Conversation

nrc
Copy link
Member

@nrc nrc commented Nov 21, 2016

Occurs when we produce save-analysis before type checking is complete (due to errors).

@rust-highfive
Copy link
Contributor

r? @arielb1

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

@nrc
Copy link
Member Author

nrc commented Nov 21, 2016

r? @eddyb

@rust-highfive rust-highfive assigned eddyb and unassigned arielb1 Nov 21, 2016
@sanxiyn
Copy link
Member

sanxiyn commented Nov 21, 2016

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

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?

Copy link
Member Author

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.

Copy link
Member

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

nrc added 3 commits November 23, 2016 11:53
Occurs when we produce save-analysis before type checking is complete (due to errors).
@nrc
Copy link
Member Author

nrc commented Nov 23, 2016

@eddyb change made

@eddyb
Copy link
Member

eddyb commented Nov 23, 2016

@bors r+

@bors
Copy link
Collaborator

bors commented Nov 23, 2016

📌 Commit b1f86fb has been approved by eddyb

@bors
Copy link
Collaborator

bors commented Nov 23, 2016

⌛ Testing commit b1f86fb with merge d5814b0...

bors added a commit that referenced this pull request Nov 23, 2016
save-analysis: fix ICE on partially resolved path

Occurs when we produce save-analysis before type checking is complete (due to errors).
@bors bors merged commit b1f86fb into rust-lang:master Nov 23, 2016
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.

6 participants