@@ -350,25 +350,25 @@ fn print_item(cx: &LateContext, item: &hir::Item) {
350
350
}
351
351
}
352
352
hir:: ItemUse ( ref path) => println ! ( "{:?}" , path. node) ,
353
- hir:: ItemStatic ( ..) => ( ) , // println!("static item: {:#?}", cx.tcx.opt_lookup_item_type (did)),
354
- hir:: ItemConst ( ..) => ( ) , // println!("const item: {:#?}", cx.tcx.opt_lookup_item_type (did)),
353
+ hir:: ItemStatic ( ..) => println ! ( "static item of type {:#?}" , cx. tcx. item_type ( did) ) ,
354
+ hir:: ItemConst ( ..) => println ! ( "const item of type {:#?}" , cx. tcx. item_type ( did) ) ,
355
355
hir:: ItemFn ( ..) => {
356
- // let item_ty = cx.tcx.opt_lookup_item_type (did);
357
- // println!("function: {:#?}", item_ty);
356
+ let item_ty = cx. tcx . item_type ( did) ;
357
+ println ! ( "function of type {:#?}" , item_ty) ;
358
358
} ,
359
359
hir:: ItemMod ( ..) => println ! ( "module" ) ,
360
360
hir:: ItemForeignMod ( ref fm) => println ! ( "foreign module with abi: {}" , fm. abi) ,
361
361
hir:: ItemTy ( ..) => {
362
- // println!("type alias: {:?}", cx.tcx.opt_lookup_item_type (did));
362
+ println ! ( "type alias for {:?}" , cx. tcx. item_type ( did) ) ;
363
363
} ,
364
364
hir:: ItemEnum ( ..) => {
365
- // println!("enum definition: {:?}", cx.tcx.opt_lookup_item_type (did));
365
+ println ! ( "enum definition of type {:?}" , cx. tcx. item_type ( did) ) ;
366
366
} ,
367
367
hir:: ItemStruct ( ..) => {
368
- // println!("struct definition: {:?}", cx.tcx.opt_lookup_item_type (did));
368
+ println ! ( "struct definition of type {:?}" , cx. tcx. item_type ( did) ) ;
369
369
} ,
370
370
hir:: ItemUnion ( ..) => {
371
- // println!("union definition: {:?}", cx.tcx.opt_lookup_item_type (did));
371
+ println ! ( "union definition of type {:?}" , cx. tcx. item_type ( did) ) ;
372
372
} ,
373
373
hir:: ItemTrait ( ..) => {
374
374
println ! ( "trait decl" ) ;
0 commit comments