Skip to content

Commit

Permalink
Rollup merge of rust-lang#132098 - RalfJung:features-since, r=jieyouxu
Browse files Browse the repository at this point in the history
rustc_feature::Features: explain what that 'Option<Symbol>' is about
  • Loading branch information
matthiaskrgr authored Oct 24, 2024
2 parents 35ebcec + 282f291 commit 7c22f47
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/rustc_feature/src/unstable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ pub struct Features {
}

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

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

0 comments on commit 7c22f47

Please sign in to comment.