@@ -6,13 +6,12 @@ use rustc_ast as ast;
6
6
use rustc_data_structures:: { fx:: FxHashMap , stable_set:: FxHashSet } ;
7
7
use rustc_errors:: { Applicability , DiagnosticBuilder } ;
8
8
use rustc_expand:: base:: SyntaxExtensionKind ;
9
- use rustc_hir as hir;
10
9
use rustc_hir:: def:: {
11
10
DefKind ,
12
11
Namespace :: { self , * } ,
13
12
PerNS ,
14
13
} ;
15
- use rustc_hir:: def_id:: { CrateNum , DefId } ;
14
+ use rustc_hir:: def_id:: { CrateNum , DefId , CRATE_DEF_ID } ;
16
15
use rustc_middle:: ty:: { DefIdTree , Ty , TyCtxt } ;
17
16
use rustc_middle:: { bug, span_bug, ty} ;
18
17
use rustc_resolve:: ParentScope ;
@@ -1736,9 +1735,9 @@ impl Disambiguator {
1736
1735
fn descr ( self ) -> & ' static str {
1737
1736
match self {
1738
1737
Self :: Namespace ( n) => n. descr ( ) ,
1739
- // HACK(jynelson): by looking at the source I saw the DefId we pass
1740
- // for `expected.descr()` doesn't matter, since it's not a crate
1741
- Self :: Kind ( k) => k. descr ( DefId :: local ( hir :: def_id :: DefIndex :: from_usize ( 0 ) ) ) ,
1738
+ // HACK(jynelson): the source of `DefKind::descr` only uses the DefId for
1739
+ // printing "module" vs "crate" so using the wrong ID is not a huge problem
1740
+ Self :: Kind ( k) => k. descr ( CRATE_DEF_ID . to_def_id ( ) ) ,
1742
1741
Self :: Primitive => "builtin type" ,
1743
1742
}
1744
1743
}
0 commit comments