File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -2152,9 +2152,6 @@ rustc_queries! {
2152
2152
desc { |tcx| "collecting child items of module `{}`" , tcx. def_path_str( def_id) }
2153
2153
separate_provide_extern
2154
2154
}
2155
- query extern_mod_stmt_cnum( def_id: LocalDefId ) -> Option <CrateNum > {
2156
- desc { |tcx| "computing crate imported by `{}`" , tcx. def_path_str( def_id) }
2157
- }
2158
2155
2159
2156
/// Gets the number of definitions in a foreign crate.
2160
2157
///
Original file line number Diff line number Diff line change @@ -3373,6 +3373,11 @@ impl<'tcx> TyCtxt<'tcx> {
3373
3373
self . resolutions ( ( ) ) . module_children . get ( & def_id) . map_or ( & [ ] , |v| & v[ ..] )
3374
3374
}
3375
3375
3376
+ /// Return the crate imported by given use item.
3377
+ pub fn extern_mod_stmt_cnum ( self , def_id : LocalDefId ) -> Option < CrateNum > {
3378
+ self . resolutions ( ( ) ) . extern_crate_map . get ( & def_id) . copied ( )
3379
+ }
3380
+
3376
3381
pub fn resolver_for_lowering ( self ) -> & ' tcx Steal < ( ty:: ResolverAstLowering , Arc < ast:: Crate > ) > {
3377
3382
self . resolver_for_lowering_raw ( ( ) ) . 0
3378
3383
}
@@ -3428,8 +3433,6 @@ pub struct DeducedParamAttrs {
3428
3433
}
3429
3434
3430
3435
pub fn provide ( providers : & mut Providers ) {
3431
- providers. extern_mod_stmt_cnum =
3432
- |tcx, id| tcx. resolutions ( ( ) ) . extern_crate_map . get ( & id) . cloned ( ) ;
3433
3436
providers. is_panic_runtime =
3434
3437
|tcx, LocalCrate | contains_name ( tcx. hir_krate_attrs ( ) , sym:: panic_runtime) ;
3435
3438
providers. is_compiler_builtins =
Original file line number Diff line number Diff line change @@ -1258,7 +1258,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
1258
1258
return ;
1259
1259
}
1260
1260
1261
- if self . tcx . extern_mod_stmt_cnum ( hir_id. owner ) . is_none ( ) {
1261
+ if self . tcx . extern_mod_stmt_cnum ( hir_id. owner . def_id ) . is_none ( ) {
1262
1262
self . tcx . emit_node_span_lint (
1263
1263
INVALID_DOC_ATTRIBUTES ,
1264
1264
hir_id,
You can’t perform that action at this time.
0 commit comments