@@ -350,25 +350,25 @@ fn print_item(cx: &LateContext, item: &hir::Item) {
350350 }
351351 }
352352 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) ) ,
355355 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) ;
358358 } ,
359359 hir:: ItemMod ( ..) => println ! ( "module" ) ,
360360 hir:: ItemForeignMod ( ref fm) => println ! ( "foreign module with abi: {}" , fm. abi) ,
361361 hir:: ItemTy ( ..) => {
362- // println!("type alias: {:?}", cx.tcx.opt_lookup_item_type (did));
362+ println ! ( "type alias for {:?}" , cx. tcx. item_type ( did) ) ;
363363 } ,
364364 hir:: ItemEnum ( ..) => {
365- // println!("enum definition: {:?}", cx.tcx.opt_lookup_item_type (did));
365+ println ! ( "enum definition of type {:?}" , cx. tcx. item_type ( did) ) ;
366366 } ,
367367 hir:: ItemStruct ( ..) => {
368- // println!("struct definition: {:?}", cx.tcx.opt_lookup_item_type (did));
368+ println ! ( "struct definition of type {:?}" , cx. tcx. item_type ( did) ) ;
369369 } ,
370370 hir:: ItemUnion ( ..) => {
371- // println!("union definition: {:?}", cx.tcx.opt_lookup_item_type (did));
371+ println ! ( "union definition of type {:?}" , cx. tcx. item_type ( did) ) ;
372372 } ,
373373 hir:: ItemTrait ( ..) => {
374374 println ! ( "trait decl" ) ;
0 commit comments