diff options
| author | bors <bors@rust-lang.org> | 2024-10-24 10:16:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-10-24 10:16:52 +0000 |
| commit | 5ae4d75effa366176dd75cd0d5662da26385cfc5 (patch) | |
| tree | 4c1befc815a8fa661455d48eb5a26e69c9ad1f5a /compiler/rustc_feature/src/unstable.rs | |
| parent | 8aca4bab080b2c81065645fc070acca7a060f8a3 (diff) | |
| parent | 7c22f47e22335e44b14dcfb3dfd61a867f8f34ed (diff) | |
| download | rust-5ae4d75effa366176dd75cd0d5662da26385cfc5.tar.gz rust-5ae4d75effa366176dd75cd0d5662da26385cfc5.zip | |
Auto merge of #132099 - matthiaskrgr:rollup-myi94r8, r=matthiaskrgr
Rollup of 5 pull requests Successful merges: - #129248 (Taking a raw ref (`&raw (const|mut)`) of a deref of pointer (`*ptr`) is always safe) - #131906 (rustdoc: adjust spacing and typography in header) - #132084 (Consider param-env candidates even if they have errors) - #132096 (Replace an FTP link in comments with an equivalent HTTPS link) - #132098 (rustc_feature::Features: explain what that 'Option<Symbol>' is about) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_feature/src/unstable.rs')
| -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 } |
