1
Fork 0

Fix removal span calculation of unused_qualifications suggestion

This commit is contained in:
许杰友 Jieyou Xu (Joe) 2023-07-18 09:10:45 +08:00
parent da6b55cc5e
commit 33bd453f35
No known key found for this signature in database
GPG key ID: 94F68FD0E4899BB0
10 changed files with 138 additions and 22 deletions

View file

@ -956,11 +956,11 @@ pub trait LintContext: Sized {
db.span_note(glob_reexport_span, format!("the name `{}` in the {} namespace is supposed to be publicly re-exported here", name, namespace));
db.span_note(private_item_span, "but the private item here shadows it".to_owned());
}
BuiltinLintDiagnostics::UnusedQualifications { path_span, unqualified_path } => {
BuiltinLintDiagnostics::UnusedQualifications { removal_span } => {
db.span_suggestion_verbose(
path_span,
"replace it with the unqualified path",
unqualified_path,
removal_span,
"remove the unnecessary path segments",
"",
Applicability::MachineApplicable
);
}