save-analysis: fix regression from #45709

closes https://github.com/nrc/rls-analysis/issues/117
This commit is contained in:
Nick Cameron 2017-11-08 09:46:06 +13:00
parent 7ade24f672
commit 95937990c5
1 changed files with 16 additions and 11 deletions

View File

@ -785,21 +785,19 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> DumpVisitor<'l, 'tcx, 'll, O> {
}
}
fn dump_path_ref(&mut self, id: NodeId, path: &ast::Path) {
let path_data = self.save_ctxt.get_path_data(id, path);
if let Some(path_data) = path_data {
self.dumper.dump_ref(path_data);
}
}
fn process_path(&mut self, id: NodeId, path: &'l ast::Path) {
debug!("process_path {:?}", path);
let path_data = self.save_ctxt.get_path_data(id, path);
if generated_code(path.span) && path_data.is_none() {
if generated_code(path.span) {
return;
}
let path_data = match path_data {
Some(pd) => pd,
None => {
return;
}
};
self.dumper.dump_ref(path_data);
self.dump_path_ref(id, path);
// Type parameters
for seg in &path.segments {
@ -1508,6 +1506,13 @@ impl<'l, 'tcx: 'l, 'll, O: DumpOutput + 'll> Visitor<'l> for DumpVisitor<'l, 'tc
});
}
}
HirDef::StructCtor(..) | HirDef::VariantCtor(..) |
HirDef::Const(..) | HirDef::AssociatedConst(..) |
HirDef::Struct(..) | HirDef::Variant(..) |
HirDef::TyAlias(..) | HirDef::AssociatedTy(..) |
HirDef::SelfTy(..) => {
self.dump_path_ref(id, &ast::Path::from_ident(sp, i));
}
def => error!("unexpected definition kind when processing collected idents: {:?}",
def),
}