diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-05 19:43:35 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2023-10-16 08:17:23 +1100 |
| commit | d284c8a2d7a2de918a966bee9c9069d7b5bf06bf (patch) | |
| tree | 0a25ff76c1863aa37269ba5d8cd2ea817078c2ef /compiler/rustc_expand/src | |
| parent | 41b689948736cc79f35b6002c040513291dcd7c2 (diff) | |
| download | rust-d284c8a2d7a2de918a966bee9c9069d7b5bf06bf.tar.gz rust-d284c8a2d7a2de918a966bee9c9069d7b5bf06bf.zip | |
Rename `ACTIVE_FEATURES` as `UNSTABLE_FEATURES`.
It's a better name, and lets "active features" refer to the features that are active in a particular program, due to being declared or enabled by the edition. The commit also renames `Features::enabled` as `Features::active` to match this; I changed my mind and have decided that "active" is a little better thatn "enabled" for this, particularly because a number of pre-existing comments use "active" in this way. Finally, the commit renames `Status::Stable` as `Status::Accepted`, to match `ACCEPTED_FEATURES`.
Diffstat (limited to 'compiler/rustc_expand/src')
| -rw-r--r-- | compiler/rustc_expand/src/config.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_expand/src/config.rs b/compiler/rustc_expand/src/config.rs index 9909a9ade8b..b73c7593381 100644 --- a/compiler/rustc_expand/src/config.rs +++ b/compiler/rustc_expand/src/config.rs @@ -15,7 +15,7 @@ use rustc_attr as attr; use rustc_data_structures::flat_map_in_place::FlatMapInPlace; use rustc_data_structures::fx::FxHashSet; use rustc_feature::Features; -use rustc_feature::{ACCEPTED_FEATURES, ACTIVE_FEATURES, REMOVED_FEATURES}; +use rustc_feature::{ACCEPTED_FEATURES, REMOVED_FEATURES, UNSTABLE_FEATURES}; use rustc_parse::validate_attr; use rustc_session::parse::feature_err; use rustc_session::Session; @@ -73,7 +73,7 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute]) -> Features { // Enable edition-dependent features based on `features_edition`. // - E.g. enable `test_2018_feature` if `features_edition` is 2018 or higher let mut edition_enabled_features = FxHashSet::default(); - for f in ACTIVE_FEATURES { + for f in UNSTABLE_FEATURES { if let Some(edition) = f.feature.edition && edition <= features_edition { // FIXME(Manishearth) there is currently no way to set lib features by // edition. @@ -165,7 +165,7 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute]) -> Features { } // If the declared feature is unstable, record it. - if let Some(f) = ACTIVE_FEATURES.iter().find(|f| name == f.feature.name) { + if let Some(f) = UNSTABLE_FEATURES.iter().find(|f| name == f.feature.name) { (f.set_enabled)(&mut features); features.set_declared_lang_feature(name, mi.span(), None); continue; |
