about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-03-20 09:14:59 +0100
committerGitHub <noreply@github.com>2022-03-20 09:14:59 +0100
commitdb374bd440fb19dd697524ff7b317219522dc545 (patch)
tree560e37062b993992d8a104f38adf17a9c742c1b1
parentacb7ed141be1ea5b4c7120708d7a48d9155fb38c (diff)
parent06a1fc98eb93ca7062b11ec45053db990a4c127f (diff)
downloadrust-db374bd440fb19dd697524ff7b317219522dc545.tar.gz
rust-db374bd440fb19dd697524ff7b317219522dc545.zip
Rollup merge of #94948 - jhpratt:rustc_deprecated, r=Dylan-DPC
Fix diagnostics for `#![feature(deprecated_suggestion)]`

Follow up from #94635, where I missed a couple things.
-rw-r--r--compiler/rustc_attr/src/builtin.rs9
-rw-r--r--src/test/ui/deprecation/feature-gate-deprecated_suggestion.stderr2
2 files changed, 5 insertions, 6 deletions
diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs
index 8a134bf7f96..8e748aaa58b 100644
--- a/compiler/rustc_attr/src/builtin.rs
+++ b/compiler/rustc_attr/src/builtin.rs
@@ -758,8 +758,7 @@ where
                                     if sess.is_nightly_build() {
                                         diag.help("add `#![feature(deprecated_suggestion)]` to the crate root");
                                     }
-                                    // FIXME(jhpratt) change this to an actual tracking issue
-                                    diag.note("see #XXX for more details").emit();
+                                    diag.note("see #94785 for more details").emit();
                                 }
 
                                 if !get(mi, &mut suggestion) {
@@ -772,10 +771,10 @@ where
                                     meta.span(),
                                     AttrError::UnknownMetaItem(
                                         pprust::path_to_string(&mi.path),
-                                        if attr.has_name(sym::deprecated) {
-                                            &["since", "note"]
-                                        } else {
+                                        if sess.features_untracked().deprecated_suggestion {
                                             &["since", "note", "suggestion"]
+                                        } else {
+                                            &["since", "note"]
                                         },
                                     ),
                                 );
diff --git a/src/test/ui/deprecation/feature-gate-deprecated_suggestion.stderr b/src/test/ui/deprecation/feature-gate-deprecated_suggestion.stderr
index 3b995fed75c..438ce3349d2 100644
--- a/src/test/ui/deprecation/feature-gate-deprecated_suggestion.stderr
+++ b/src/test/ui/deprecation/feature-gate-deprecated_suggestion.stderr
@@ -5,7 +5,7 @@ LL | #[deprecated(suggestion = "foo")]
    |              ^^^^^^^^^^^^^^^^^^
    |
    = help: add `#![feature(deprecated_suggestion)]` to the crate root
-   = note: see #XXX for more details
+   = note: see #94785 for more details
 
 error: aborting due to previous error