Move the unused extern crate check back to the resolver.
This commit is contained in:
parent
b869e84e58
commit
958419d354
8 changed files with 190 additions and 169 deletions
|
@ -893,6 +893,23 @@ pub trait LintContext: Sized {
|
|||
BuiltinLintDiagnostics::ByteSliceInPackedStructWithDerive => {
|
||||
db.help("consider implementing the trait by hand, or remove the `packed` attribute");
|
||||
}
|
||||
BuiltinLintDiagnostics::UnusedExternCrate { removal_span }=> {
|
||||
db.span_suggestion(
|
||||
removal_span,
|
||||
"remove it",
|
||||
"",
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
}
|
||||
BuiltinLintDiagnostics::ExternCrateNotIdiomatic { vis_span, ident_span }=> {
|
||||
let suggestion_span = vis_span.between(ident_span);
|
||||
db.span_suggestion_verbose(
|
||||
suggestion_span,
|
||||
"convert it to a `use`",
|
||||
if vis_span.is_empty() { "use " } else { " use " },
|
||||
Applicability::MachineApplicable,
|
||||
);
|
||||
}
|
||||
}
|
||||
// Rewrap `db`, and pass control to the user.
|
||||
decorate(db)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue