diff options
| author | bors <bors@rust-lang.org> | 2021-11-30 07:40:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-11-30 07:40:08 +0000 |
| commit | 90912e68ab0b9e7ba4f91ef9654e8b41c203a95d (patch) | |
| tree | 23470a3e178b70da3a4cdc87b6da5bf6e6338429 | |
| parent | 4c948963306dc195d5b20a0b4300d90a2b423b8b (diff) | |
| parent | 877b2d79d98428cdc9b971a627a7adf10533aed8 (diff) | |
| download | rust-90912e68ab0b9e7ba4f91ef9654e8b41c203a95d.tar.gz rust-90912e68ab0b9e7ba4f91ef9654e8b41c203a95d.zip | |
Auto merge of #91330 - cjgillot:no-ee-features, r=Aaron1011
Remove eval_always for lib_features. r? `@Aaron1011`
| -rw-r--r-- | compiler/rustc_metadata/src/rmeta/encoder.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/query/mod.rs | 3 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/lib_features.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_passes/src/stability.rs | 2 |
5 files changed, 5 insertions, 11 deletions
diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index 576113870f8..514a49d7e2c 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -1749,7 +1749,7 @@ impl EncodeContext<'a, 'tcx> { fn encode_lib_features(&mut self) -> Lazy<[(Symbol, Option<Symbol>)]> { empty_proc_macro!(self); let tcx = self.tcx; - let lib_features = tcx.lib_features(); + let lib_features = tcx.lib_features(()); self.lazy(lib_features.to_vec()) } diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index ca93efbf19b..268a66b9926 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -1485,9 +1485,8 @@ rustc_queries! { desc { |tcx| "computing crate imported by `{}`", tcx.def_path_str(def_id.to_def_id()) } } - query get_lib_features(_: ()) -> LibFeatures { + query lib_features(_: ()) -> LibFeatures { storage(ArenaCacheSelector<'tcx>) - eval_always desc { "calculating the lib features map" } } query defined_lib_features(_: CrateNum) diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index 8240273acad..822458d3127 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -5,7 +5,6 @@ use crate::dep_graph::{DepGraph, DepKind, DepKindStruct}; use crate::hir::place::Place as HirPlace; use crate::infer::canonical::{Canonical, CanonicalVarInfo, CanonicalVarInfos}; use crate::lint::{struct_lint_level, LintDiagnosticBuilder, LintLevelSource}; -use crate::middle; use crate::middle::resolve_lifetime::{self, LifetimeScopeForPath, ObjectLifetimeDefault}; use crate::middle::stability; use crate::mir::interpret::{self, Allocation, ConstValue, Scalar}; @@ -1217,10 +1216,6 @@ impl<'tcx> TyCtxt<'tcx> { self.sess.consider_optimizing(&cname, msg) } - pub fn lib_features(self) -> &'tcx middle::lib_features::LibFeatures { - self.get_lib_features(()) - } - /// Obtain all lang items of this crate and all dependencies (recursively) pub fn lang_items(self) -> &'tcx rustc_hir::lang_items::LanguageItems { self.get_lang_items(()) diff --git a/compiler/rustc_passes/src/lib_features.rs b/compiler/rustc_passes/src/lib_features.rs index ff8bd37238d..10b8c3104fc 100644 --- a/compiler/rustc_passes/src/lib_features.rs +++ b/compiler/rustc_passes/src/lib_features.rs @@ -124,12 +124,12 @@ impl Visitor<'tcx> for LibFeatureCollector<'tcx> { } } -fn get_lib_features(tcx: TyCtxt<'_>, (): ()) -> LibFeatures { +fn lib_features(tcx: TyCtxt<'_>, (): ()) -> LibFeatures { let mut collector = LibFeatureCollector::new(tcx); tcx.hir().walk_attributes(&mut collector); collector.lib_features } pub fn provide(providers: &mut Providers) { - providers.get_lib_features = get_lib_features; + providers.lib_features = lib_features; } diff --git a/compiler/rustc_passes/src/stability.rs b/compiler/rustc_passes/src/stability.rs index 8c9f04bef13..92911c3cd24 100644 --- a/compiler/rustc_passes/src/stability.rs +++ b/compiler/rustc_passes/src/stability.rs @@ -970,7 +970,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) { // We always collect the lib features declared in the current crate, even if there are // no unknown features, because the collection also does feature attribute validation. - let local_defined_features = tcx.lib_features().to_vec(); + let local_defined_features = tcx.lib_features(()).to_vec(); if !remaining_lib_features.is_empty() { check_features(&mut remaining_lib_features, &local_defined_features); |
