File tree Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Expand file tree Collapse file tree 3 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -2140,9 +2140,6 @@ rustc_queries! {
2140
2140
desc { |tcx| "collecting child items of module `{}`" , tcx. def_path_str( def_id) }
2141
2141
separate_provide_extern
2142
2142
}
2143
- query extern_mod_stmt_cnum( def_id: LocalDefId ) -> Option <CrateNum > {
2144
- desc { |tcx| "computing crate imported by `{}`" , tcx. def_path_str( def_id) }
2145
- }
2146
2143
2147
2144
/// Gets the number of definitions in a foreign crate.
2148
2145
///
Original file line number Diff line number Diff line change @@ -3360,6 +3360,11 @@ impl<'tcx> TyCtxt<'tcx> {
3360
3360
self . resolutions ( ( ) ) . module_children . get ( & def_id) . map_or ( & [ ] , |v| & v[ ..] )
3361
3361
}
3362
3362
3363
+ /// Return the crate imported by given use item.
3364
+ pub fn extern_mod_stmt_cnum ( self , def_id : LocalDefId ) -> Option < CrateNum > {
3365
+ self . resolutions ( ( ) ) . extern_crate_map . get ( & def_id) . copied ( )
3366
+ }
3367
+
3363
3368
pub fn resolver_for_lowering ( self ) -> & ' tcx Steal < ( ty:: ResolverAstLowering , Arc < ast:: Crate > ) > {
3364
3369
self . resolver_for_lowering_raw ( ( ) ) . 0
3365
3370
}
@@ -3416,9 +3421,6 @@ pub fn provide(providers: &mut Providers) {
3416
3421
providers. names_imported_by_glob_use = |tcx, id| {
3417
3422
tcx. arena . alloc ( tcx. resolutions ( ( ) ) . glob_map . get ( & id) . cloned ( ) . unwrap_or_default ( ) )
3418
3423
} ;
3419
-
3420
- providers. extern_mod_stmt_cnum =
3421
- |tcx, id| tcx. resolutions ( ( ) ) . extern_crate_map . get ( & id) . cloned ( ) ;
3422
3424
providers. is_panic_runtime =
3423
3425
|tcx, LocalCrate | contains_name ( tcx. hir_krate_attrs ( ) , sym:: panic_runtime) ;
3424
3426
providers. is_compiler_builtins =
Original file line number Diff line number Diff line change @@ -1193,7 +1193,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
1193
1193
return ;
1194
1194
}
1195
1195
1196
- if self . tcx . extern_mod_stmt_cnum ( hir_id. owner ) . is_none ( ) {
1196
+ if self . tcx . extern_mod_stmt_cnum ( hir_id. owner . def_id ) . is_none ( ) {
1197
1197
self . tcx . emit_node_span_lint (
1198
1198
INVALID_DOC_ATTRIBUTES ,
1199
1199
hir_id,
You can’t perform that action at this time.
0 commit comments