about summary refs log tree commit diff
path: root/compiler/rustc_save_analysis/src/lib.rs
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2022-11-25 17:39:38 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2022-12-01 18:51:05 +0300
commit1f259ae6799e7e0a08e5b84fc5686e404b17eef0 (patch)
tree388417f61bf1eb19e633f3e613353f01c05b8730 /compiler/rustc_save_analysis/src/lib.rs
parent6cd4dd3091dfe0ce4a728bd9ae177361fba23736 (diff)
downloadrust-1f259ae6799e7e0a08e5b84fc5686e404b17eef0.tar.gz
rust-1f259ae6799e7e0a08e5b84fc5686e404b17eef0.zip
rustc_hir: Change representation of import paths to support multiple resolutions
Diffstat (limited to 'compiler/rustc_save_analysis/src/lib.rs')
-rw-r--r--compiler/rustc_save_analysis/src/lib.rs4
1 files changed, 3 insertions, 1 deletions
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