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! {
21402140 desc { |tcx| "collecting child items of module `{}`" , tcx. def_path_str( def_id) }
21412141 separate_provide_extern
21422142 }
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- }
21462143
21472144 /// Gets the number of definitions in a foreign crate.
21482145 ///
Original file line number Diff line number Diff line change @@ -3360,6 +3360,11 @@ impl<'tcx> TyCtxt<'tcx> {
33603360 self . resolutions ( ( ) ) . module_children . get ( & def_id) . map_or ( & [ ] , |v| & v[ ..] )
33613361 }
33623362
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+
33633368 pub fn resolver_for_lowering ( self ) -> & ' tcx Steal < ( ty:: ResolverAstLowering , Arc < ast:: Crate > ) > {
33643369 self . resolver_for_lowering_raw ( ( ) ) . 0
33653370 }
@@ -3416,9 +3421,6 @@ pub fn provide(providers: &mut Providers) {
34163421 providers. names_imported_by_glob_use = |tcx, id| {
34173422 tcx. arena . alloc ( tcx. resolutions ( ( ) ) . glob_map . get ( & id) . cloned ( ) . unwrap_or_default ( ) )
34183423 } ;
3419-
3420- providers. extern_mod_stmt_cnum =
3421- |tcx, id| tcx. resolutions ( ( ) ) . extern_crate_map . get ( & id) . cloned ( ) ;
34223424 providers. is_panic_runtime =
34233425 |tcx, LocalCrate | contains_name ( tcx. hir_krate_attrs ( ) , sym:: panic_runtime) ;
34243426 providers. is_compiler_builtins =
Original file line number Diff line number Diff line change @@ -1193,7 +1193,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
11931193 return ;
11941194 }
11951195
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 ( ) {
11971197 self . tcx . emit_node_span_lint (
11981198 INVALID_DOC_ATTRIBUTES ,
11991199 hir_id,
You can’t perform that action at this time.
0 commit comments