From 08fbe3dafa24429d17009bd5ee475e10a53be9b6 Mon Sep 17 00:00:00 2001 From: Jacob Pratt Date: Mon, 14 Mar 2022 22:01:06 -0400 Subject: [PATCH 1/2] Include tracking issue in diagnostic --- compiler/rustc_attr/src/builtin.rs | 3 +-- .../ui/deprecation/feature-gate-deprecated_suggestion.stderr | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs index 613320087d2..ffad7dcf557 100644 --- a/compiler/rustc_attr/src/builtin.rs +++ b/compiler/rustc_attr/src/builtin.rs @@ -750,8 +750,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) { 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 From 06a1fc98eb93ca7062b11ec45053db990a4c127f Mon Sep 17 00:00:00 2001 From: Jacob Pratt Date: Mon, 14 Mar 2022 22:05:30 -0400 Subject: [PATCH 2/2] Correct meta item diagnostic --- compiler/rustc_attr/src/builtin.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_attr/src/builtin.rs b/compiler/rustc_attr/src/builtin.rs index ffad7dcf557..e1eb014738f 100644 --- a/compiler/rustc_attr/src/builtin.rs +++ b/compiler/rustc_attr/src/builtin.rs @@ -763,10 +763,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"] }, ), );