Skip to content

Commit 7c22f47

Browse files
authored
Rollup merge of #132098 - RalfJung:features-since, r=jieyouxu
rustc_feature::Features: explain what that 'Option<Symbol>' is about
2 parents 35ebcec + 282f291 commit 7c22f47

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/rustc_feature/src/unstable.rs

+6
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ pub struct Features {
4444
}
4545

4646
impl Features {
47+
/// `since` should be set for stable features that are nevertheless enabled with a `#[feature]`
48+
/// attribute, indicating since when they are stable.
4749
pub fn set_enabled_lang_feature(&mut self, name: Symbol, span: Span, since: Option<Symbol>) {
4850
self.enabled_lang_features.push((name, span, since));
4951
self.enabled_features.insert(name);
@@ -54,6 +56,10 @@ impl Features {
5456
self.enabled_features.insert(name);
5557
}
5658

59+
/// Returns a list of triples with:
60+
/// - feature gate name
61+
/// - the span of the `#[feature]` attribute
62+
/// - (for already stable features) the version since which it is stable
5763
pub fn enabled_lang_features(&self) -> &Vec<(Symbol, Span, Option<Symbol>)> {
5864
&self.enabled_lang_features
5965
}

0 commit comments

Comments
 (0)