Error on #[rustc_deprecated]
This commit is contained in:
parent
4fbe73e0b7
commit
e46f8b23dd
11 changed files with 85 additions and 34 deletions
|
@ -687,6 +687,14 @@ where
|
|||
break;
|
||||
}
|
||||
|
||||
// FIXME(jhpratt) remove this eventually
|
||||
if attr.has_name(sym::rustc_deprecated) {
|
||||
diagnostic
|
||||
.struct_span_err(attr.span, "`#[rustc_deprecated]` has been removed")
|
||||
.help("use `#[deprecated]` instead")
|
||||
.emit();
|
||||
}
|
||||
|
||||
let Some(meta) = attr.meta() else {
|
||||
continue;
|
||||
};
|
||||
|
@ -742,12 +750,24 @@ where
|
|||
continue 'outer;
|
||||
}
|
||||
}
|
||||
// FIXME(jhpratt) remove this after a bootstrap occurs. Emitting an
|
||||
// error specific to the renaming would be a good idea as well.
|
||||
// FIXME(jhpratt) remove this eventually
|
||||
sym::reason if attr.has_name(sym::rustc_deprecated) => {
|
||||
if !get(mi, &mut note) {
|
||||
continue 'outer;
|
||||
}
|
||||
|
||||
let mut diag = diagnostic
|
||||
.struct_span_err(mi.span, "`reason` has been renamed");
|
||||
match note {
|
||||
Some(note) => diag.span_suggestion(
|
||||
mi.span,
|
||||
"use `note` instead",
|
||||
format!("note = \"{note}\""),
|
||||
Applicability::MachineApplicable,
|
||||
),
|
||||
None => diag.span_help(mi.span, "use `note` instead"),
|
||||
};
|
||||
diag.emit();
|
||||
}
|
||||
sym::suggestion => {
|
||||
if !sess.features_untracked().deprecated_suggestion {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue