remove no longer needd UnstableFeature type
This commit is contained in:
parent
6ad17bd30c
commit
e82bca6f32
@ -103,7 +103,7 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute], crate_name: Symbol) -
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If the enabled feature is unstable, record it.
|
// If the enabled feature is unstable, record it.
|
||||||
if UNSTABLE_FEATURES.iter().find(|f| name == f.feature.name).is_some() {
|
if UNSTABLE_FEATURES.iter().find(|f| name == f.name).is_some() {
|
||||||
// When the ICE comes from core, alloc or std (approximation of the standard
|
// When the ICE comes from core, alloc or std (approximation of the standard
|
||||||
// library), there's a chance that the person hitting the ICE may be using
|
// library), there's a chance that the person hitting the ICE may be using
|
||||||
// -Zbuild-std or similar with an untested target. The bug is probably in the
|
// -Zbuild-std or similar with an untested target. The bug is probably in the
|
||||||
|
@ -94,8 +94,8 @@ impl UnstableFeatures {
|
|||||||
|
|
||||||
fn find_lang_feature_issue(feature: Symbol) -> Option<NonZero<u32>> {
|
fn find_lang_feature_issue(feature: Symbol) -> Option<NonZero<u32>> {
|
||||||
// Search in all the feature lists.
|
// Search in all the feature lists.
|
||||||
if let Some(f) = UNSTABLE_FEATURES.iter().find(|f| f.feature.name == feature) {
|
if let Some(f) = UNSTABLE_FEATURES.iter().find(|f| f.name == feature) {
|
||||||
return f.feature.issue;
|
return f.issue;
|
||||||
}
|
}
|
||||||
if let Some(f) = ACCEPTED_FEATURES.iter().find(|f| f.name == feature) {
|
if let Some(f) = ACCEPTED_FEATURES.iter().find(|f| f.name == feature) {
|
||||||
return f.issue;
|
return f.issue;
|
||||||
|
@ -6,10 +6,6 @@ use rustc_span::symbol::{Symbol, sym};
|
|||||||
|
|
||||||
use super::{Feature, to_nonzero};
|
use super::{Feature, to_nonzero};
|
||||||
|
|
||||||
pub struct UnstableFeature {
|
|
||||||
pub feature: Feature,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(PartialEq)]
|
#[derive(PartialEq)]
|
||||||
enum FeatureStatus {
|
enum FeatureStatus {
|
||||||
Default,
|
Default,
|
||||||
@ -82,13 +78,11 @@ macro_rules! declare_features {
|
|||||||
)+) => {
|
)+) => {
|
||||||
/// Unstable language features that are being implemented or being
|
/// Unstable language features that are being implemented or being
|
||||||
/// considered for acceptance (stabilization) or removal.
|
/// considered for acceptance (stabilization) or removal.
|
||||||
pub const UNSTABLE_FEATURES: &[UnstableFeature] = &[
|
pub const UNSTABLE_FEATURES: &[Feature] = &[
|
||||||
$(UnstableFeature {
|
$(Feature {
|
||||||
feature: Feature {
|
name: sym::$feature,
|
||||||
name: sym::$feature,
|
since: $ver,
|
||||||
since: $ver,
|
issue: to_nonzero($issue),
|
||||||
issue: to_nonzero($issue),
|
|
||||||
},
|
|
||||||
}),+
|
}),+
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ impl<'tcx> HashStable<StableHashingContext<'tcx>> for rustc_feature::Features {
|
|||||||
|
|
||||||
// FIXME: why do we hash something that is a compile-time constant?
|
// FIXME: why do we hash something that is a compile-time constant?
|
||||||
for feature in rustc_feature::UNSTABLE_FEATURES.iter() {
|
for feature in rustc_feature::UNSTABLE_FEATURES.iter() {
|
||||||
feature.feature.name.hash_stable(hcx, hasher);
|
feature.name.hash_stable(hcx, hasher);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user