diff options
Diffstat (limited to 'compiler/rustc_save_analysis/src')
| -rw-r--r-- | compiler/rustc_save_analysis/src/dump_visitor.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_save_analysis/src/lib.rs | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/compiler/rustc_save_analysis/src/dump_visitor.rs b/compiler/rustc_save_analysis/src/dump_visitor.rs index fae20c2ba5f..b4528853825 100644 --- a/compiler/rustc_save_analysis/src/dump_visitor.rs +++ b/compiler/rustc_save_analysis/src/dump_visitor.rs @@ -185,13 +185,13 @@ impl<'tcx> DumpVisitor<'tcx> { } } - fn write_sub_paths(&mut self, path: &'tcx hir::Path<'tcx>) { + fn write_sub_paths<R>(&mut self, path: &'tcx hir::Path<'tcx, R>) { self.write_segments(path.segments) } // As write_sub_paths, but does not process the last ident in the path (assuming it // will be processed elsewhere). See note on write_sub_paths about global. - fn write_sub_paths_truncated(&mut self, path: &'tcx hir::Path<'tcx>) { + fn write_sub_paths_truncated<R>(&mut self, path: &'tcx hir::Path<'tcx, R>) { if let [segments @ .., _] = path.segments { self.write_segments(segments) } diff --git a/compiler/rustc_save_analysis/src/lib.rs b/compiler/rustc_save_analysis/src/lib.rs index 4fa0c14715e..f05eb2b7432 100644 --- a/compiler/rustc_save_analysis/src/lib.rs +++ b/compiler/rustc_save_analysis/src/lib.rs @@ -594,7 +594,9 @@ impl<'tcx> SaveContext<'tcx> { match self.tcx.hir().get(hir_id) { Node::TraitRef(tr) => tr.path.res, - Node::Item(&hir::Item { kind: hir::ItemKind::Use(path, _), .. }) => path.res, + Node::Item(&hir::Item { kind: hir::ItemKind::Use(path, _), .. }) => { + path.res.get(0).copied().unwrap_or(Res::Err) + } Node::PathSegment(seg) => { if seg.res != Res::Err { seg.res |
