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:
parent
5a6ca7a38d
commit
c53fa9a898
1 changed files with 4 additions and 0 deletions
|
@ -545,7 +545,11 @@ impl<'l, 'tcx: 'l> SaveContext<'l, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_path_data(&self, id: NodeId, path: &ast::Path) -> Option<Data> {
|
pub fn get_path_data(&self, id: NodeId, path: &ast::Path) -> Option<Data> {
|
||||||
|
<<<<<<< HEAD
|
||||||
let def = self.get_path_def(id);
|
let def = self.get_path_def(id);
|
||||||
|
=======
|
||||||
|
let def = option_try!(self.tcx.expect_resolution(id).maybe_full_def());
|
||||||
|
>>>>>>> save-analysis: fix ICE on partially resolved path
|
||||||
let sub_span = self.span_utils.span_for_last_ident(path.span);
|
let sub_span = self.span_utils.span_for_last_ident(path.span);
|
||||||
filter!(self.span_utils, sub_span, path.span, None);
|
filter!(self.span_utils, sub_span, path.span, None);
|
||||||
match def {
|
match def {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue