1
Fork 0

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

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

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