Be more specific when flagging imports that are redundant due to the extern prelude
This commit is contained in:
parent
5dbaafdb93
commit
8a24ddf64b
9 changed files with 108 additions and 13 deletions
|
@ -105,7 +105,7 @@ pub(super) fn builtin(sess: &Session, diagnostic: BuiltinLintDiag, diag: &mut Di
|
|||
BuiltinLintDiag::RedundantImport(spans, ident) => {
|
||||
for (span, is_imported) in spans {
|
||||
let introduced = if is_imported { "imported" } else { "defined" };
|
||||
let span_msg = if span.is_dummy() { "by prelude" } else { "here" };
|
||||
let span_msg = if span.is_dummy() { "by the extern prelude" } else { "here" };
|
||||
diag.span_label(
|
||||
span,
|
||||
format!("the item `{ident}` is already {introduced} {span_msg}"),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue