about summary refs log tree commit diff
path: root/compiler/rustc_feature/src/unstable.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2024-10-24 10:35:42 +0200
committerGitHub <noreply@github.com>2024-10-24 10:35:42 +0200
commit7c22f47e22335e44b14dcfb3dfd61a867f8f34ed (patch)
tree4c1befc815a8fa661455d48eb5a26e69c9ad1f5a /compiler/rustc_feature/src/unstable.rs
parent35ebcec2f7e7c9c682589d77f7398792898275d6 (diff)
parent282f291b7de339951f44e4d0ba6d64571876099a (diff)
downloadrust-7c22f47e22335e44b14dcfb3dfd61a867f8f34ed.tar.gz
rust-7c22f47e22335e44b14dcfb3dfd61a867f8f34ed.zip
Rollup merge of #132098 - RalfJung:features-since, r=jieyouxu
rustc_feature::Features: explain what that 'Option<Symbol>' is about
Diffstat (limited to 'compiler/rustc_feature/src/unstable.rs')
-rw-r--r--compiler/rustc_feature/src/unstable.rs6
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
     }