Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit eb20905

Browse files
committed
Rename Resolver::active_features.
For the reasons described in the previous commit.
1 parent 4602d92 commit eb20905

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

compiler/rustc_resolve/src/lib.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,8 +1074,8 @@ pub struct Resolver<'a, 'tcx> {
10741074
/// Also includes of list of each fields visibility
10751075
struct_constructors: LocalDefIdMap<(Res, ty::Visibility<DefId>, Vec<ty::Visibility<DefId>>)>,
10761076

1077-
/// Features enabled for this crate.
1078-
active_features: FxHashSet<Symbol>,
1077+
/// Features declared for this crate.
1078+
declared_features: FxHashSet<Symbol>,
10791079

10801080
lint_buffer: LintBuffer,
10811081

@@ -1417,12 +1417,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
14171417
multi_segment_macro_resolutions: Default::default(),
14181418
builtin_attrs: Default::default(),
14191419
containers_deriving_copy: Default::default(),
1420-
active_features: features
1421-
.declared_lib_features
1422-
.iter()
1423-
.map(|(feat, ..)| *feat)
1424-
.chain(features.declared_lang_features.iter().map(|(feat, ..)| *feat))
1425-
.collect(),
1420+
declared_features: features.declared_features.clone(),
14261421
lint_buffer: LintBuffer::default(),
14271422
next_node_id: CRATE_NODE_ID,
14281423
node_id_to_def_id,

compiler/rustc_resolve/src/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -854,7 +854,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
854854
let feature = stability.feature;
855855

856856
let is_allowed = |feature| {
857-
self.active_features.contains(&feature) || span.allows_unstable(feature)
857+
self.declared_features.contains(&feature) || span.allows_unstable(feature)
858858
};
859859
let allowed_by_implication = implied_by.is_some_and(|feature| is_allowed(feature));
860860
if !is_allowed(feature) && !allowed_by_implication {

0 commit comments

Comments
 (0)