Auto merge of #91330 - cjgillot:no-ee-features, r=Aaron1011

Remove eval_always for lib_features.

r? `@Aaron1011`
This commit is contained in:
bors 2021-11-30 07:40:08 +00:00
commit 90912e68ab
5 changed files with 5 additions and 11 deletions

View File

@ -1749,7 +1749,7 @@ fn encode_crate_deps(&mut self) -> Lazy<[CrateDep]> {
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())
}

View File

@ -1485,9 +1485,8 @@
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)

View File

@ -5,7 +5,6 @@
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 @@ pub fn consider_optimizing<T: Fn() -> String>(self, msg: T) -> bool {
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(())

View File

@ -124,12 +124,12 @@ fn visit_attribute(&mut self, _: rustc_hir::HirId, attr: &'tcx Attribute) {
}
}
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;
}

View File

@ -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);