Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e82bca6

Browse files
committed
remove no longer needd UnstableFeature type
1 parent 6ad17bd commit e82bca6

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

‎compiler/rustc_expand/src/config.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub fn features(sess: &Session, krate_attrs: &[Attribute], crate_name: Symbol) -
103103
}
104104

105105
// If the enabled feature is unstable, record it.
106-
if UNSTABLE_FEATURES.iter().find(|f| name == f.feature.name).is_some() {
106+
if UNSTABLE_FEATURES.iter().find(|f| name == f.name).is_some() {
107107
// When the ICE comes from core, alloc or std (approximation of the standard
108108
// library), there's a chance that the person hitting the ICE may be using
109109
// -Zbuild-std or similar with an untested target. The bug is probably in the

‎compiler/rustc_feature/src/lib.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ impl UnstableFeatures {
9494

9595
fn find_lang_feature_issue(feature: Symbol) -> Option<NonZero<u32>> {
9696
// Search in all the feature lists.
97-
if let Some(f) = UNSTABLE_FEATURES.iter().find(|f| f.feature.name == feature) {
98-
return f.feature.issue;
97+
if let Some(f) = UNSTABLE_FEATURES.iter().find(|f| f.name == feature) {
98+
return f.issue;
9999
}
100100
if let Some(f) = ACCEPTED_FEATURES.iter().find(|f| f.name == feature) {
101101
return f.issue;

‎compiler/rustc_feature/src/unstable.rs‎

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ use rustc_span::symbol::{Symbol, sym};
66

77
use super::{Feature, to_nonzero};
88

9-
pub struct UnstableFeature {
10-
pub feature: Feature,
11-
}
12-
139
#[derive(PartialEq)]
1410
enum FeatureStatus {
1511
Default,
@@ -82,13 +78,11 @@ macro_rules! declare_features {
8278
)+) => {
8379
/// Unstable language features that are being implemented or being
8480
/// considered for acceptance (stabilization) or removal.
85-
pub const UNSTABLE_FEATURES: &[UnstableFeature] = &[
86-
$(UnstableFeature {
87-
feature: Feature {
88-
name: sym::$feature,
89-
since: $ver,
90-
issue: to_nonzero($issue),
91-
},
81+
pub const UNSTABLE_FEATURES: &[Feature] = &[
82+
$(Feature {
83+
name: sym::$feature,
84+
since: $ver,
85+
issue: to_nonzero($issue),
9286
}),+
9387
];
9488

‎compiler/rustc_query_system/src/ich/impls_syntax.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl<'tcx> HashStable<StableHashingContext<'tcx>> for rustc_feature::Features {
117117

118118
// FIXME: why do we hash something that is a compile-time constant?
119119
for feature in rustc_feature::UNSTABLE_FEATURES.iter() {
120-
feature.feature.name.hash_stable(hcx, hasher);
120+
feature.name.hash_stable(hcx, hasher);
121121
}
122122
}
123123
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /