1
Fork 0

rename lang feature lists to include LANG

This commit is contained in:
Ralf Jung 2024-10-23 08:20:02 +01:00
parent e82bca6f32
commit 44638853f5
7 changed files with 18 additions and 17 deletions

View file

@ -9,7 +9,7 @@ macro_rules! declare_features {
$(#[doc = $doc:tt])* (accepted, $feature:ident, $ver:expr, $issue:expr),
)+) => {
/// Formerly unstable features that have now been accepted (stabilized).
pub const ACCEPTED_FEATURES: &[Feature] = &[
pub const ACCEPTED_LANG_FEATURES: &[Feature] = &[
$(Feature {
name: sym::$feature,
since: $ver,

View file

@ -94,13 +94,13 @@ impl UnstableFeatures {
fn find_lang_feature_issue(feature: Symbol) -> Option<NonZero<u32>> {
// Search in all the feature lists.
if let Some(f) = UNSTABLE_FEATURES.iter().find(|f| f.name == feature) {
if let Some(f) = UNSTABLE_LANG_FEATURES.iter().find(|f| f.name == feature) {
return f.issue;
}
if let Some(f) = ACCEPTED_FEATURES.iter().find(|f| f.name == feature) {
if let Some(f) = ACCEPTED_LANG_FEATURES.iter().find(|f| f.name == feature) {
return f.issue;
}
if let Some(f) = REMOVED_FEATURES.iter().find(|f| f.feature.name == feature) {
if let Some(f) = REMOVED_LANG_FEATURES.iter().find(|f| f.feature.name == feature) {
return f.feature.issue;
}
panic!("feature `{feature}` is not declared anywhere");
@ -127,12 +127,12 @@ pub fn find_feature_issue(feature: Symbol, issue: GateIssue) -> Option<NonZero<u
}
}
pub use accepted::ACCEPTED_FEATURES;
pub use accepted::ACCEPTED_LANG_FEATURES;
pub use builtin_attrs::{
AttributeDuplicates, AttributeGate, AttributeSafety, AttributeTemplate, AttributeType,
BUILTIN_ATTRIBUTE_MAP, BUILTIN_ATTRIBUTES, BuiltinAttribute, GatedCfg, deprecated_attributes,
encode_cross_crate, find_gated_cfg, is_builtin_attr_name, is_stable_diagnostic_attribute,
is_valid_for_get_attr,
};
pub use removed::REMOVED_FEATURES;
pub use unstable::{Features, INCOMPATIBLE_FEATURES, UNSTABLE_FEATURES};
pub use removed::REMOVED_LANG_FEATURES;
pub use unstable::{Features, INCOMPATIBLE_FEATURES, UNSTABLE_LANG_FEATURES};

View file

@ -14,7 +14,7 @@ macro_rules! declare_features {
$(#[doc = $doc:tt])* (removed, $feature:ident, $ver:expr, $issue:expr, $reason:expr),
)+) => {
/// Formerly unstable features that have now been removed.
pub const REMOVED_FEATURES: &[RemovedFeature] = &[
pub const REMOVED_LANG_FEATURES: &[RemovedFeature] = &[
$(RemovedFeature {
feature: Feature {
name: sym::$feature,

View file

@ -78,7 +78,7 @@ macro_rules! declare_features {
)+) => {
/// Unstable language features that are being implemented or being
/// considered for acceptance (stabilization) or removal.
pub const UNSTABLE_FEATURES: &[Feature] = &[
pub const UNSTABLE_LANG_FEATURES: &[Feature] = &[
$(Feature {
name: sym::$feature,
since: $ver,