about summary refs log tree commit diff
path: root/compiler/rustc_feature/src/lib.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2023-10-05 19:43:35 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2023-10-16 08:17:23 +1100
commitd284c8a2d7a2de918a966bee9c9069d7b5bf06bf (patch)
tree0a25ff76c1863aa37269ba5d8cd2ea817078c2ef /compiler/rustc_feature/src/lib.rs
parent41b689948736cc79f35b6002c040513291dcd7c2 (diff)
downloadrust-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_feature/src/lib.rs')
-rw-r--r--compiler/rustc_feature/src/lib.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_feature/src/lib.rs b/compiler/rustc_feature/src/lib.rs
index 42bf15262d7..9f23ec662b9 100644
--- a/compiler/rustc_feature/src/lib.rs
+++ b/compiler/rustc_feature/src/lib.rs
@@ -16,9 +16,9 @@
 #![deny(rustc::diagnostic_outside_of_impl)]
 
 mod accepted;
-mod active;
 mod builtin_attrs;
 mod removed;
+mod unstable;
 
 #[cfg(test)]
 mod tests;
@@ -44,9 +44,9 @@ pub enum Stability {
 
 #[derive(Clone, Copy, Debug, Hash)]
 pub enum UnstableFeatures {
-    /// Hard errors for unstable features are active, as on beta/stable channels.
+    /// Disallow use of unstable features, as on beta/stable channels.
     Disallow,
-    /// Allow features to be activated, as on nightly.
+    /// Allow use of unstable features, as on nightly.
     Allow,
     /// Errors are bypassed for bootstrapping. This is required any time
     /// during the build that feature-related lints are set to warn or above
@@ -87,7 +87,7 @@ impl UnstableFeatures {
 
 fn find_lang_feature_issue(feature: Symbol) -> Option<NonZeroU32> {
     // Search in all the feature lists.
-    if let Some(f) = ACTIVE_FEATURES.iter().find(|f| f.feature.name == feature) {
+    if let Some(f) = UNSTABLE_FEATURES.iter().find(|f| f.feature.name == feature) {
         return f.feature.issue;
     }
     if let Some(f) = ACCEPTED_FEATURES.iter().find(|f| f.name == feature) {
@@ -121,7 +121,6 @@ pub fn find_feature_issue(feature: Symbol, issue: GateIssue) -> Option<NonZeroU3
 }
 
 pub use accepted::ACCEPTED_FEATURES;
-pub use active::{Features, ACTIVE_FEATURES, INCOMPATIBLE_FEATURES};
 pub use builtin_attrs::AttributeDuplicates;
 pub use builtin_attrs::{
     deprecated_attributes, find_gated_cfg, is_builtin_attr_name, is_builtin_only_local,
@@ -129,3 +128,4 @@ pub use builtin_attrs::{
     GatedCfg, BUILTIN_ATTRIBUTES, BUILTIN_ATTRIBUTE_MAP,
 };
 pub use removed::REMOVED_FEATURES;
+pub use unstable::{Features, INCOMPATIBLE_FEATURES, UNSTABLE_FEATURES};