Skip to content

Commit 490af18

Browse files
authored
Rollup merge of rust-lang#94948 - jhpratt:rustc_deprecated, r=Dylan-DPC
Fix diagnostics for `#![feature(deprecated_suggestion)]` Follow up from rust-lang#94635, where I missed a couple things.
2 parents 8fad514 + 06a1fc9 commit 490af18

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

compiler/rustc_attr/src/builtin.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -758,8 +758,7 @@ where
758758
if sess.is_nightly_build() {
759759
diag.help("add `#![feature(deprecated_suggestion)]` to the crate root");
760760
}
761-
// FIXME(jhpratt) change this to an actual tracking issue
762-
diag.note("see #XXX for more details").emit();
761+
diag.note("see #94785 for more details").emit();
763762
}
764763

765764
if !get(mi, &mut suggestion) {
@@ -772,10 +771,10 @@ where
772771
meta.span(),
773772
AttrError::UnknownMetaItem(
774773
pprust::path_to_string(&mi.path),
775-
if attr.has_name(sym::deprecated) {
776-
&["since", "note"]
777-
} else {
774+
if sess.features_untracked().deprecated_suggestion {
778775
&["since", "note", "suggestion"]
776+
} else {
777+
&["since", "note"]
779778
},
780779
),
781780
);

src/test/ui/deprecation/feature-gate-deprecated_suggestion.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ LL | #[deprecated(suggestion = "foo")]
55
| ^^^^^^^^^^^^^^^^^^
66
|
77
= help: add `#![feature(deprecated_suggestion)]` to the crate root
8-
= note: see #XXX for more details
8+
= note: see #94785 for more details
99

1010
error: aborting due to previous error
1111

0 commit comments

Comments
 (0)