diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-05 16:20:07 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-05 18:01:11 +1100 |
| commit | eb209057b1c7a1e7852793e8f53eadfc9d839b2c (patch) | |
| tree | 55ffeb430d48937836c942081f092413d6984edb | |
| parent | 4602d9257de0939ff8770dcf7f10ac1832bce35f (diff) | |
| download | rust-eb209057b1c7a1e7852793e8f53eadfc9d839b2c.tar.gz rust-eb209057b1c7a1e7852793e8f53eadfc9d839b2c.zip | |
Rename `Resolver::active_features`.
For the reasons described in the previous commit.
| -rw-r--r-- | compiler/rustc_resolve/src/lib.rs | 11 | ||||
| -rw-r--r-- | compiler/rustc_resolve/src/macros.rs | 2 |
2 files changed, 4 insertions, 9 deletions
diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index 949c6ab5ac0..5f012ec29fe 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -1074,8 +1074,8 @@ pub struct Resolver<'a, 'tcx> { /// Also includes of list of each fields visibility struct_constructors: LocalDefIdMap<(Res, ty::Visibility<DefId>, Vec<ty::Visibility<DefId>>)>, - /// Features enabled for this crate. - active_features: FxHashSet<Symbol>, + /// Features declared for this crate. + declared_features: FxHashSet<Symbol>, lint_buffer: LintBuffer, @@ -1417,12 +1417,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { multi_segment_macro_resolutions: Default::default(), builtin_attrs: Default::default(), containers_deriving_copy: Default::default(), - active_features: features - .declared_lib_features - .iter() - .map(|(feat, ..)| *feat) - .chain(features.declared_lang_features.iter().map(|(feat, ..)| *feat)) - .collect(), + declared_features: features.declared_features.clone(), lint_buffer: LintBuffer::default(), next_node_id: CRATE_NODE_ID, node_id_to_def_id, diff --git a/compiler/rustc_resolve/src/macros.rs b/compiler/rustc_resolve/src/macros.rs index 90ae08ce37c..f0a1a4ff931 100644 --- a/compiler/rustc_resolve/src/macros.rs +++ b/compiler/rustc_resolve/src/macros.rs @@ -854,7 +854,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { let feature = stability.feature; let is_allowed = |feature| { - self.active_features.contains(&feature) || span.allows_unstable(feature) + self.declared_features.contains(&feature) || span.allows_unstable(feature) }; let allowed_by_implication = implied_by.is_some_and(|feature| is_allowed(feature)); if !is_allowed(feature) && !allowed_by_implication { |
