Improve deprecation attribute diagnostic messages.
(From the PR feedback.) Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
This commit is contained in:
parent
9fc991a0ea
commit
9c647d1021
5 changed files with 12 additions and 19 deletions
|
@ -92,10 +92,10 @@ impl<'a, 'tcx> Annotator<'a, 'tcx> {
|
|||
|
||||
if kind == AnnotationKind::Prohibited || kind == AnnotationKind::DeprecationProhibited {
|
||||
self.tcx.struct_span_lint_hir(USELESS_DEPRECATED, hir_id, *span, |lint| {
|
||||
lint.build("this `#[deprecated]' annotation has no effect")
|
||||
.span_suggestion(
|
||||
lint.build("this `#[deprecated]` annotation has no effect")
|
||||
.span_suggestion_short(
|
||||
*span,
|
||||
"try removing the deprecation attribute",
|
||||
"remove the unnecessary deprecation attribute",
|
||||
String::new(),
|
||||
rustc_errors::Applicability::MachineApplicable,
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue