Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 83a2eb9

Browse files
Unrolled build for #143374
Rollup merge of #143374 - cjgillot:bare-extern-crate-map, r=petrochenkov Unquerify extern_mod_stmt_cnum. Based on #143247 r? `````@ghost````` for perf
2 parents 5d22242 + 3440bc9 commit 83a2eb9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

‎compiler/rustc_middle/src/query/mod.rs‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2152,9 +2152,6 @@ rustc_queries! {
21522152
desc { |tcx| "collecting child items of module `{}`", tcx.def_path_str(def_id) }
21532153
separate_provide_extern
21542154
}
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-
}
21582155

21592156
/// Gets the number of definitions in a foreign crate.
21602157
///

‎compiler/rustc_middle/src/ty/context.rs‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3377,6 +3377,11 @@ impl<'tcx> TyCtxt<'tcx> {
33773377
self.resolutions(()).module_children.get(&def_id).map_or(&[], |v| &v[..])
33783378
}
33793379

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+
33803385
pub fn resolver_for_lowering(self) -> &'tcx Steal<(ty::ResolverAstLowering, Arc<ast::Crate>)> {
33813386
self.resolver_for_lowering_raw(()).0
33823387
}
@@ -3432,8 +3437,6 @@ pub struct DeducedParamAttrs {
34323437
}
34333438

34343439
pub fn provide(providers: &mut Providers) {
3435-
providers.extern_mod_stmt_cnum =
3436-
|tcx, id| tcx.resolutions(()).extern_crate_map.get(&id).cloned();
34373440
providers.is_panic_runtime =
34383441
|tcx, LocalCrate| contains_name(tcx.hir_krate_attrs(), sym::panic_runtime);
34393442
providers.is_compiler_builtins =

‎compiler/rustc_passes/src/check_attr.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1258,7 +1258,7 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
12581258
return;
12591259
}
12601260

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() {
12621262
self.tcx.emit_node_span_lint(
12631263
INVALID_DOC_ATTRIBUTES,
12641264
hir_id,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /