diff options
| author | Ralf Jung <post@ralfj.de> | 2024-10-24 08:15:28 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-10-24 08:15:28 +0200 |
| commit | 282f291b7de339951f44e4d0ba6d64571876099a (patch) | |
| tree | b00f7f7feaabdb724bb7e5f69549ea7b9ea02390 | |
| parent | 55b7f8e800a6a43657a8582450323d546297c950 (diff) | |
| download | rust-282f291b7de339951f44e4d0ba6d64571876099a.tar.gz rust-282f291b7de339951f44e4d0ba6d64571876099a.zip | |
rustc_feature::Features: explain what that 'Option<Symbol>' is about
| -rw-r--r-- | compiler/rustc_feature/src/unstable.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_feature/src/unstable.rs b/compiler/rustc_feature/src/unstable.rs index 8f4c208f1fb..8182eb1e973 100644 --- a/compiler/rustc_feature/src/unstable.rs +++ b/compiler/rustc_feature/src/unstable.rs @@ -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); @@ -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 } |
