Skip to content

Commit 90912e6

Browse files
committed
Auto merge of #91330 - cjgillot:no-ee-features, r=Aaron1011
Remove eval_always for lib_features. r? `@Aaron1011`
2 parents 4c94896 + 877b2d7 commit 90912e6

File tree

5 files changed

+5
-11
lines changed

5 files changed

+5
-11
lines changed

compiler/rustc_metadata/src/rmeta/encoder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1749,7 +1749,7 @@ impl EncodeContext<'a, 'tcx> {
17491749
fn encode_lib_features(&mut self) -> Lazy<[(Symbol, Option<Symbol>)]> {
17501750
empty_proc_macro!(self);
17511751
let tcx = self.tcx;
1752-
let lib_features = tcx.lib_features();
1752+
let lib_features = tcx.lib_features(());
17531753
self.lazy(lib_features.to_vec())
17541754
}
17551755

compiler/rustc_middle/src/query/mod.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1485,9 +1485,8 @@ rustc_queries! {
14851485
desc { |tcx| "computing crate imported by `{}`", tcx.def_path_str(def_id.to_def_id()) }
14861486
}
14871487

1488-
query get_lib_features(_: ()) -> LibFeatures {
1488+
query lib_features(_: ()) -> LibFeatures {
14891489
storage(ArenaCacheSelector<'tcx>)
1490-
eval_always
14911490
desc { "calculating the lib features map" }
14921491
}
14931492
query defined_lib_features(_: CrateNum)

compiler/rustc_middle/src/ty/context.rs

-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use crate::dep_graph::{DepGraph, DepKind, DepKindStruct};
55
use crate::hir::place::Place as HirPlace;
66
use crate::infer::canonical::{Canonical, CanonicalVarInfo, CanonicalVarInfos};
77
use crate::lint::{struct_lint_level, LintDiagnosticBuilder, LintLevelSource};
8-
use crate::middle;
98
use crate::middle::resolve_lifetime::{self, LifetimeScopeForPath, ObjectLifetimeDefault};
109
use crate::middle::stability;
1110
use crate::mir::interpret::{self, Allocation, ConstValue, Scalar};
@@ -1217,10 +1216,6 @@ impl<'tcx> TyCtxt<'tcx> {
12171216
self.sess.consider_optimizing(&cname, msg)
12181217
}
12191218

1220-
pub fn lib_features(self) -> &'tcx middle::lib_features::LibFeatures {
1221-
self.get_lib_features(())
1222-
}
1223-
12241219
/// Obtain all lang items of this crate and all dependencies (recursively)
12251220
pub fn lang_items(self) -> &'tcx rustc_hir::lang_items::LanguageItems {
12261221
self.get_lang_items(())

compiler/rustc_passes/src/lib_features.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,12 @@ impl Visitor<'tcx> for LibFeatureCollector<'tcx> {
124124
}
125125
}
126126

127-
fn get_lib_features(tcx: TyCtxt<'_>, (): ()) -> LibFeatures {
127+
fn lib_features(tcx: TyCtxt<'_>, (): ()) -> LibFeatures {
128128
let mut collector = LibFeatureCollector::new(tcx);
129129
tcx.hir().walk_attributes(&mut collector);
130130
collector.lib_features
131131
}
132132

133133
pub fn provide(providers: &mut Providers) {
134-
providers.get_lib_features = get_lib_features;
134+
providers.lib_features = lib_features;
135135
}

compiler/rustc_passes/src/stability.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ pub fn check_unused_or_stable_features(tcx: TyCtxt<'_>) {
970970

971971
// We always collect the lib features declared in the current crate, even if there are
972972
// no unknown features, because the collection also does feature attribute validation.
973-
let local_defined_features = tcx.lib_features().to_vec();
973+
let local_defined_features = tcx.lib_features(()).to_vec();
974974
if !remaining_lib_features.is_empty() {
975975
check_features(&mut remaining_lib_features, &local_defined_features);
976976

0 commit comments

Comments
 (0)