@@ -107,7 +107,7 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
107
107
where
108
108
F : FnOnce ( & mut Self ) ,
109
109
{
110
- let item_def_id = self . tcx . hir ( ) . local_def_id_from_node_id ( item_id) ;
110
+ let item_def_id = self . tcx . hir ( ) . local_def_id_from_node_id ( item_id) . to_def_id ( ) ;
111
111
112
112
let tables = if self . tcx . has_typeck_tables ( item_def_id) {
113
113
self . tcx . typeck_tables_of ( item_def_id)
@@ -423,8 +423,10 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
423
423
vis : ast:: Visibility ,
424
424
attrs : & ' l [ Attribute ] ,
425
425
) {
426
- let qualname =
427
- format ! ( "::{}" , self . tcx. def_path_str( self . tcx. hir( ) . local_def_id_from_node_id( id) ) ) ;
426
+ let qualname = format ! (
427
+ "::{}" ,
428
+ self . tcx. def_path_str( self . tcx. hir( ) . local_def_id_from_node_id( id) . to_def_id( ) )
429
+ ) ;
428
430
429
431
if !self . span . filter_generated ( ident. span ) {
430
432
let sig = sig:: assoc_const_signature ( id, ident. name , typ, expr, & self . save_ctxt ) ;
@@ -470,7 +472,7 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
470
472
let name = item. ident . to_string ( ) ;
471
473
let qualname = format ! (
472
474
"::{}" ,
473
- self . tcx. def_path_str( self . tcx. hir( ) . local_def_id_from_node_id( item. id) )
475
+ self . tcx. def_path_str( self . tcx. hir( ) . local_def_id_from_node_id( item. id) . to_def_id ( ) )
474
476
) ;
475
477
476
478
let kind = match item. kind {
@@ -670,7 +672,7 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
670
672
}
671
673
v. process_generic_params ( generics, "" , item. id ) ;
672
674
for impl_item in impl_items {
673
- v. process_impl_item ( impl_item, map. local_def_id_from_node_id ( item. id ) ) ;
675
+ v. process_impl_item ( impl_item, map. local_def_id_from_node_id ( item. id ) . to_def_id ( ) ) ;
674
676
}
675
677
} ) ;
676
678
}
@@ -685,7 +687,7 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
685
687
let name = item. ident . to_string ( ) ;
686
688
let qualname = format ! (
687
689
"::{}" ,
688
- self . tcx. def_path_str( self . tcx. hir( ) . local_def_id_from_node_id( item. id) )
690
+ self . tcx. def_path_str( self . tcx. hir( ) . local_def_id_from_node_id( item. id) . to_def_id ( ) )
689
691
) ;
690
692
let mut val = name. clone ( ) ;
691
693
if !generics. params . is_empty ( ) {
@@ -751,7 +753,7 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
751
753
self . process_generic_params ( generics, & qualname, item. id ) ;
752
754
for method in methods {
753
755
let map = & self . tcx . hir ( ) ;
754
- self . process_trait_item ( method, map. local_def_id_from_node_id ( item. id ) )
756
+ self . process_trait_item ( method, map. local_def_id_from_node_id ( item. id ) . to_def_id ( ) )
755
757
}
756
758
}
757
759
@@ -1030,7 +1032,9 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
1030
1032
let name = trait_item. ident . name . to_string ( ) ;
1031
1033
let qualname = format ! (
1032
1034
"::{}" ,
1033
- self . tcx. def_path_str( self . tcx. hir( ) . local_def_id_from_node_id( trait_item. id) )
1035
+ self . tcx. def_path_str(
1036
+ self . tcx. hir( ) . local_def_id_from_node_id( trait_item. id) . to_def_id( )
1037
+ )
1034
1038
) ;
1035
1039
1036
1040
if !self . span . filter_generated ( trait_item. ident . span ) {
@@ -1134,7 +1138,7 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
1134
1138
. tcx
1135
1139
. hir ( )
1136
1140
. opt_local_def_id_from_node_id ( id)
1137
- . and_then ( |id| self . save_ctxt . tcx . parent ( id) )
1141
+ . and_then ( |id| self . save_ctxt . tcx . parent ( id. to_def_id ( ) ) )
1138
1142
. map ( id_from_def_id) ;
1139
1143
1140
1144
match use_tree. kind {
@@ -1173,7 +1177,7 @@ impl<'l, 'tcx> DumpVisitor<'l, 'tcx> {
1173
1177
1174
1178
// Make a comma-separated list of names of imported modules.
1175
1179
let def_id = self . tcx . hir ( ) . local_def_id_from_node_id ( id) ;
1176
- let names = self . tcx . names_imported_by_glob_use ( def_id) ;
1180
+ let names = self . tcx . names_imported_by_glob_use ( def_id. to_def_id ( ) ) ;
1177
1181
let names: Vec < _ > = names. iter ( ) . map ( |n| n. to_string ( ) ) . collect ( ) ;
1178
1182
1179
1183
// Otherwise it's a span with wrong macro expansion info, which
@@ -1227,8 +1231,10 @@ impl<'l, 'tcx> Visitor<'l> for DumpVisitor<'l, 'tcx> {
1227
1231
// only get called for the root module of a crate.
1228
1232
assert_eq ! ( id, ast:: CRATE_NODE_ID ) ;
1229
1233
1230
- let qualname =
1231
- format ! ( "::{}" , self . tcx. def_path_str( self . tcx. hir( ) . local_def_id_from_node_id( id) ) ) ;
1234
+ let qualname = format ! (
1235
+ "::{}" ,
1236
+ self . tcx. def_path_str( self . tcx. hir( ) . local_def_id_from_node_id( id) . to_def_id( ) )
1237
+ ) ;
1232
1238
1233
1239
let sm = self . tcx . sess . source_map ( ) ;
1234
1240
let filename = sm. span_to_filename ( span) ;
@@ -1273,7 +1279,7 @@ impl<'l, 'tcx> Visitor<'l> for DumpVisitor<'l, 'tcx> {
1273
1279
. tcx
1274
1280
. hir ( )
1275
1281
. opt_local_def_id_from_node_id ( item. id )
1276
- . and_then ( |id| self . save_ctxt . tcx . parent ( id) )
1282
+ . and_then ( |id| self . save_ctxt . tcx . parent ( id. to_def_id ( ) ) )
1277
1283
. map ( id_from_def_id) ;
1278
1284
self . dumper . import (
1279
1285
& Access { public : false , reachable : false } ,
@@ -1311,7 +1317,9 @@ impl<'l, 'tcx> Visitor<'l> for DumpVisitor<'l, 'tcx> {
1311
1317
TyAlias ( _, ref ty_params, _, ref ty) => {
1312
1318
let qualname = format ! (
1313
1319
"::{}" ,
1314
- self . tcx. def_path_str( self . tcx. hir( ) . local_def_id_from_node_id( item. id) )
1320
+ self . tcx. def_path_str(
1321
+ self . tcx. hir( ) . local_def_id_from_node_id( item. id) . to_def_id( )
1322
+ )
1315
1323
) ;
1316
1324
let value = match ty {
1317
1325
Some ( ty) => ty_to_string ( & ty) ,
0 commit comments