@@ -607,10 +607,6 @@ impl<'a, 'tcx> CrateMetadata {
607
607
}
608
608
}
609
609
610
- fn is_proc_macro_crate ( & self ) -> bool {
611
- self . root . is_proc_macro_crate ( )
612
- }
613
-
614
610
fn is_proc_macro ( & self , id : DefIndex ) -> bool {
615
611
self . root . proc_macro_data . and_then ( |data| data. decode ( self ) . find ( |x| * x == id) ) . is_some ( )
616
612
}
@@ -895,7 +891,7 @@ impl<'a, 'tcx> CrateMetadata {
895
891
896
892
/// Iterates over the language items in the given crate.
897
893
fn get_lang_items ( & self , tcx : TyCtxt < ' tcx > ) -> & ' tcx [ ( DefId , usize ) ] {
898
- if self . is_proc_macro_crate ( ) {
894
+ if self . root . is_proc_macro_crate ( ) {
899
895
// Proc macro crates do not export any lang-items to the target.
900
896
& [ ]
901
897
} else {
@@ -911,7 +907,7 @@ impl<'a, 'tcx> CrateMetadata {
911
907
& self ,
912
908
tcx : TyCtxt < ' tcx > ,
913
909
) -> & ' tcx FxHashMap < Symbol , DefId > {
914
- tcx. arena . alloc ( if self . is_proc_macro_crate ( ) {
910
+ tcx. arena . alloc ( if self . root . is_proc_macro_crate ( ) {
915
911
// Proc macro crates do not export any diagnostic-items to the target.
916
912
Default :: default ( )
917
913
} else {
@@ -1219,7 +1215,7 @@ impl<'a, 'tcx> CrateMetadata {
1219
1215
tcx : TyCtxt < ' tcx > ,
1220
1216
filter : Option < DefId > ,
1221
1217
) -> & ' tcx [ DefId ] {
1222
- if self . is_proc_macro_crate ( ) {
1218
+ if self . root . is_proc_macro_crate ( ) {
1223
1219
// proc-macro crates export no trait impls.
1224
1220
return & [ ]
1225
1221
}
@@ -1263,7 +1259,7 @@ impl<'a, 'tcx> CrateMetadata {
1263
1259
1264
1260
1265
1261
fn get_native_libraries ( & self , sess : & Session ) -> Vec < NativeLibrary > {
1266
- if self . is_proc_macro_crate ( ) {
1262
+ if self . root . is_proc_macro_crate ( ) {
1267
1263
// Proc macro crates do not have any *target* native libraries.
1268
1264
vec ! [ ]
1269
1265
} else {
@@ -1272,7 +1268,7 @@ impl<'a, 'tcx> CrateMetadata {
1272
1268
}
1273
1269
1274
1270
fn get_foreign_modules ( & self , tcx : TyCtxt < ' tcx > ) -> & ' tcx [ ForeignModule ] {
1275
- if self . is_proc_macro_crate ( ) {
1271
+ if self . root . is_proc_macro_crate ( ) {
1276
1272
// Proc macro crates do not have any *target* foreign modules.
1277
1273
& [ ]
1278
1274
} else {
@@ -1295,7 +1291,7 @@ impl<'a, 'tcx> CrateMetadata {
1295
1291
}
1296
1292
1297
1293
fn get_missing_lang_items ( & self , tcx : TyCtxt < ' tcx > ) -> & ' tcx [ lang_items:: LangItem ] {
1298
- if self . is_proc_macro_crate ( ) {
1294
+ if self . root . is_proc_macro_crate ( ) {
1299
1295
// Proc macro crates do not depend on any target weak lang-items.
1300
1296
& [ ]
1301
1297
} else {
@@ -1319,7 +1315,7 @@ impl<'a, 'tcx> CrateMetadata {
1319
1315
& self ,
1320
1316
tcx : TyCtxt < ' tcx > ,
1321
1317
) -> Vec < ( ExportedSymbol < ' tcx > , SymbolExportLevel ) > {
1322
- if self . is_proc_macro_crate ( ) {
1318
+ if self . root . is_proc_macro_crate ( ) {
1323
1319
// If this crate is a custom derive crate, then we're not even going to
1324
1320
// link those in so we skip those crates.
1325
1321
vec ! [ ]
0 commit comments