@@ -7,7 +7,7 @@ use rustc_data_structures::fingerprint::Fingerprint;
77use rustc_data_structures:: fx:: FxHashMap ;
88use rustc_data_structures:: stable_hasher:: { HashStable , StableHasher } ;
99use rustc_hir:: def_id:: { CrateNum , DefId , LocalDefId , LOCAL_CRATE } ;
10- use rustc_hir:: HirId ;
10+ use rustc_hir:: { HirId , ItemId } ;
1111use rustc_session:: config:: OptLevel ;
1212use rustc_span:: source_map:: Span ;
1313use rustc_span:: symbol:: Symbol ;
@@ -43,7 +43,7 @@ pub enum InstantiationMode {
4343pub enum MonoItem < ' tcx > {
4444 Fn ( Instance < ' tcx > ) ,
4545 Static ( DefId ) ,
46- GlobalAsm ( HirId ) ,
46+ GlobalAsm ( ItemId ) ,
4747}
4848
4949impl < ' tcx > MonoItem < ' tcx > {
@@ -71,8 +71,8 @@ impl<'tcx> MonoItem<'tcx> {
7171 match * self {
7272 MonoItem :: Fn ( instance) => tcx. symbol_name ( instance) ,
7373 MonoItem :: Static ( def_id) => tcx. symbol_name ( Instance :: mono ( tcx, def_id) ) ,
74- MonoItem :: GlobalAsm ( hir_id ) => {
75- let def_id = tcx. hir ( ) . local_def_id ( hir_id) ;
74+ MonoItem :: GlobalAsm ( item_id ) => {
75+ let def_id = tcx. hir ( ) . local_def_id ( item_id . hir_id ( ) ) ;
7676 SymbolName :: new ( tcx, & format ! ( "global_asm_{:?}" , def_id) )
7777 }
7878 }
@@ -178,7 +178,7 @@ impl<'tcx> MonoItem<'tcx> {
178178 MonoItem :: Static ( def_id) => {
179179 def_id. as_local ( ) . map ( |def_id| tcx. hir ( ) . local_def_id_to_hir_id ( def_id) )
180180 }
181- MonoItem :: GlobalAsm ( hir_id ) => Some ( hir_id) ,
181+ MonoItem :: GlobalAsm ( item_id ) => Some ( item_id . hir_id ( ) ) ,
182182 }
183183 . map ( |hir_id| tcx. hir ( ) . span ( hir_id) )
184184 }
@@ -195,9 +195,9 @@ impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for MonoItem<'tcx> {
195195 MonoItem :: Static ( def_id) => {
196196 def_id. hash_stable ( hcx, hasher) ;
197197 }
198- MonoItem :: GlobalAsm ( node_id ) => {
198+ MonoItem :: GlobalAsm ( item_id ) => {
199199 hcx. with_node_id_hashing_mode ( NodeIdHashingMode :: HashDefPath , |hcx| {
200- node_id . hash_stable ( hcx, hasher) ;
200+ item_id . hash_stable ( hcx, hasher) ;
201201 } )
202202 }
203203 }
@@ -351,7 +351,7 @@ impl<'tcx> CodegenUnit<'tcx> {
351351 MonoItem :: Static ( def_id) => {
352352 def_id. as_local ( ) . map ( |def_id| tcx. hir ( ) . local_def_id_to_hir_id ( def_id) )
353353 }
354- MonoItem :: GlobalAsm ( hir_id ) => Some ( hir_id) ,
354+ MonoItem :: GlobalAsm ( item_id ) => Some ( item_id . hir_id ( ) ) ,
355355 } ,
356356 item. symbol_name ( tcx) ,
357357 )
0 commit comments