diff options
| author | mejrs <59372212+mejrs@users.noreply.github.com> | 2025-05-18 18:35:13 +0200 |
|---|---|---|
| committer | mejrs <59372212+mejrs@users.noreply.github.com> | 2025-06-09 11:44:24 +0200 |
| commit | 959d6de1a928061256bb845025597be11ddca2ea (patch) | |
| tree | 18d17efbdd2c330cb8d7793df929261fb548c11b /compiler/rustc_session/src/parse.rs | |
| parent | 52882f6522ae9f34f1d574b2efabc4b18e691ae0 (diff) | |
| download | rust-959d6de1a928061256bb845025597be11ddca2ea.tar.gz rust-959d6de1a928061256bb845025597be11ddca2ea.zip | |
refactor `AttributeGate` and `rustc_attr!` to emit notes during feature checking
Diffstat (limited to 'compiler/rustc_session/src/parse.rs')
| -rw-r--r-- | compiler/rustc_session/src/parse.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index 1fe521bd32d..87c848cf857 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -17,7 +17,7 @@ use rustc_feature::{GateIssue, UnstableFeatures, find_feature_issue}; use rustc_span::edition::Edition; use rustc_span::hygiene::ExpnId; use rustc_span::source_map::{FilePathMapping, SourceMap}; -use rustc_span::{Span, Symbol}; +use rustc_span::{Span, Symbol, sym}; use crate::Session; use crate::config::{Cfg, CheckCfg}; @@ -192,8 +192,11 @@ pub fn add_feature_diagnostics_for_issue<G: EmissionGuarantee>( } else { err.subdiagnostic(FeatureDiagnosticHelp { feature }); } - - if sess.opts.unstable_opts.ui_testing { + if feature == sym::rustc_attrs { + // We're unlikely to stabilize something out of `rustc_attrs` + // without at least renaming it, so pointing out how old + // the compiler is will do little good. + } else if sess.opts.unstable_opts.ui_testing { err.subdiagnostic(SuggestUpgradeCompiler::ui_testing()); } else if let Some(suggestion) = SuggestUpgradeCompiler::new() { err.subdiagnostic(suggestion); |
