1616// reachable as well.
1717
1818use hir:: { CodegenFnAttrs , CodegenFnAttrFlags } ;
19- use hir:: map as hir_map ;
19+ use hir:: map:: NodeKind ;
2020use hir:: def:: Def ;
2121use hir:: def_id:: { DefId , CrateNum } ;
2222use rustc_data_structures:: sync:: Lrc ;
@@ -64,7 +64,7 @@ fn method_might_be_inlined<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
6464 }
6565 if let Some ( impl_node_id) = tcx. hir . as_local_node_id ( impl_src) {
6666 match tcx. hir . find ( impl_node_id) {
67- Some ( hir_map :: NodeKind :: Item ( item) ) =>
67+ Some ( NodeKind :: Item ( item) ) =>
6868 item_might_be_inlined ( tcx, & item, codegen_fn_attrs) ,
6969 Some ( ..) | None =>
7070 span_bug ! ( impl_item. span, "impl did is not an item" )
@@ -156,22 +156,22 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
156156 } ;
157157
158158 match self . tcx . hir . find ( node_id) {
159- Some ( hir_map :: NodeKind :: Item ( item) ) => {
159+ Some ( NodeKind :: Item ( item) ) => {
160160 match item. node {
161161 hir:: ItemKind :: Fn ( ..) =>
162162 item_might_be_inlined ( self . tcx , & item, self . tcx . codegen_fn_attrs ( def_id) ) ,
163163 _ => false ,
164164 }
165165 }
166- Some ( hir_map :: NodeKind :: TraitItem ( trait_method) ) => {
166+ Some ( NodeKind :: TraitItem ( trait_method) ) => {
167167 match trait_method. node {
168168 hir:: TraitItemKind :: Const ( _, ref default) => default. is_some ( ) ,
169169 hir:: TraitItemKind :: Method ( _, hir:: TraitMethod :: Provided ( _) ) => true ,
170170 hir:: TraitItemKind :: Method ( _, hir:: TraitMethod :: Required ( _) ) |
171171 hir:: TraitItemKind :: Type ( ..) => false ,
172172 }
173173 }
174- Some ( hir_map :: NodeKind :: ImplItem ( impl_item) ) => {
174+ Some ( NodeKind :: ImplItem ( impl_item) ) => {
175175 match impl_item. node {
176176 hir:: ImplItemKind :: Const ( ..) => true ,
177177 hir:: ImplItemKind :: Method ( ..) => {
@@ -219,12 +219,12 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
219219 }
220220 }
221221
222- fn propagate_node ( & mut self , node : & hir_map :: NodeKind < ' tcx > ,
222+ fn propagate_node ( & mut self , node : & NodeKind < ' tcx > ,
223223 search_item : ast:: NodeId ) {
224224 if !self . any_library {
225225 // If we are building an executable, only explicitly extern
226226 // types need to be exported.
227- if let hir_map :: NodeKind :: Item ( item) = * node {
227+ if let NodeKind :: Item ( item) = * node {
228228 let reachable = if let hir:: ItemKind :: Fn ( _, header, ..) = item. node {
229229 header. abi != Abi :: Rust
230230 } else {
@@ -248,7 +248,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
248248 }
249249
250250 match * node {
251- hir_map :: NodeKind :: Item ( item) => {
251+ NodeKind :: Item ( item) => {
252252 match item. node {
253253 hir:: ItemKind :: Fn ( .., body) => {
254254 let def_id = self . tcx . hir . local_def_id ( item. id ) ;
@@ -285,7 +285,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
285285 hir:: ItemKind :: GlobalAsm ( ..) => { }
286286 }
287287 }
288- hir_map :: NodeKind :: TraitItem ( trait_method) => {
288+ NodeKind :: TraitItem ( trait_method) => {
289289 match trait_method. node {
290290 hir:: TraitItemKind :: Const ( _, None ) |
291291 hir:: TraitItemKind :: Method ( _, hir:: TraitMethod :: Required ( _) ) => {
@@ -298,7 +298,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
298298 hir:: TraitItemKind :: Type ( ..) => { }
299299 }
300300 }
301- hir_map :: NodeKind :: ImplItem ( impl_item) => {
301+ NodeKind :: ImplItem ( impl_item) => {
302302 match impl_item. node {
303303 hir:: ImplItemKind :: Const ( _, body) => {
304304 self . visit_nested_body ( body) ;
@@ -313,16 +313,16 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
313313 hir:: ImplItemKind :: Type ( _) => { }
314314 }
315315 }
316- hir_map :: NodeKind :: Expr ( & hir:: Expr { node : hir:: ExprKind :: Closure ( .., body, _, _) , .. } ) => {
316+ NodeKind :: Expr ( & hir:: Expr { node : hir:: ExprKind :: Closure ( .., body, _, _) , .. } ) => {
317317 self . visit_nested_body ( body) ;
318318 }
319319 // Nothing to recurse on for these
320- hir_map :: NodeKind :: ForeignItem ( _) |
321- hir_map :: NodeKind :: Variant ( _) |
322- hir_map :: NodeKind :: StructCtor ( _) |
323- hir_map :: NodeKind :: Field ( _) |
324- hir_map :: NodeKind :: Ty ( _) |
325- hir_map :: NodeKind :: MacroDef ( _) => { }
320+ NodeKind :: ForeignItem ( _) |
321+ NodeKind :: Variant ( _) |
322+ NodeKind :: StructCtor ( _) |
323+ NodeKind :: Field ( _) |
324+ NodeKind :: Ty ( _) |
325+ NodeKind :: MacroDef ( _) => { }
326326 _ => {
327327 bug ! ( "found unexpected thingy in worklist: {}" ,
328328 self . tcx. hir. node_to_string( search_item) )
0 commit comments