save-analysis: fix ICE on partially resolved path

Occurs when we produce save-analysis before type checking is complete (due to errors).
This commit is contained in:
Nick Cameron 2016-11-21 18:11:36 +13:00
parent 4bc9290133
commit 3295afa6e2
2 changed files with 9 additions and 4 deletions

View file

@ -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());
let sub_span = self.span_utils.span_for_last_ident(path.span);
filter!(self.span_utils, sub_span, path.span, None);
match def {