Skip to content

Commit

Permalink
Unrolled build for rust-lang#132098
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#132098 - RalfJung:features-since, r=jieyouxu

rustc_feature::Features: explain what that 'Option<Symbol>' is about
  • Loading branch information
rust-timer authored Oct 24, 2024
2 parents 8aca4ba + 282f291 commit ad80f3d
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 ad80f3d

Please sign in to comment.