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`.
This commit is contained in:
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user