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 @@ -3377,6 +3377,11 @@ impl<'tcx> TyCtxt<'tcx> {
3377
3377
self . resolutions ( ( ) ) . module_children . get ( & def_id) . map_or ( & [ ] , |v| & v[ ..] )
3378
3378
}
3379
3379
3380
+ /// Return the crate imported by given use item.
3381
+ pub fn extern_mod_stmt_cnum ( self , def_id : LocalDefId ) -> Option < CrateNum > {
3382
+ self . resolutions ( ( ) ) . extern_crate_map . get ( & def_id) . copied ( )
3383
+ }
3384
+
3380
3385
pub fn resolver_for_lowering ( self ) -> & ' tcx Steal < ( ty:: ResolverAstLowering , Arc < ast:: Crate > ) > {
3381
3386
self . resolver_for_lowering_raw ( ( ) ) . 0
3382
3387
}
@@ -3432,8 +3437,6 @@ pub struct DeducedParamAttrs {
3432
3437
}
3433
3438
3434
3439
pub fn provide ( providers : & mut Providers ) {
3435
- providers. extern_mod_stmt_cnum =
3436
- |tcx, id| tcx. resolutions ( ( ) ) . extern_crate_map . get ( & id) . cloned ( ) ;
3437
3440
providers. is_panic_runtime =
3438
3441
|tcx, LocalCrate | contains_name ( tcx. hir_krate_attrs ( ) , sym:: panic_runtime) ;
3439
3442
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