1
Fork 0

Improve deprecation attribute diagnostic messages.

(From the PR feedback.)

Co-authored-by: Esteban Küber <esteban@kuber.com.ar>
This commit is contained in:
Mara Bos 2020-11-02 13:17:14 +01:00
parent 9fc991a0ea
commit 9c647d1021
5 changed files with 12 additions and 19 deletions

View file

@ -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,
)