Skip to content

Commit 1acd048

Browse files
committed
Be more specific when flagging imports that are redundant due to the extern prelude
1 parent b3df0d7 commit 1acd048

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

compiler/rustc_lint/src/context/diagnostics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ pub(super) fn builtin(sess: &Session, diagnostic: BuiltinLintDiag, diag: &mut Di
105105
BuiltinLintDiag::RedundantImport(spans, ident) => {
106106
for (span, is_imported) in spans {
107107
let introduced = if is_imported { "imported" } else { "defined" };
108-
let span_msg = if span.is_dummy() { "by prelude" } else { "here" };
108+
let span_msg = if span.is_dummy() { "by the extern prelude" } else { "here" };
109109
diag.span_label(
110110
span,
111111
format!("the item `{ident}` is already {introduced} {span_msg}"),

tests/ui/imports/redundant-import-issue-121915.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ error: the item `aux_issue_121915` is imported redundantly
22
--> $DIR/redundant-import-issue-121915.rs:6:9
33
|
44
LL | use aux_issue_121915;
5-
| ^^^^^^^^^^^^^^^^ the item `aux_issue_121915` is already defined by prelude
5+
| ^^^^^^^^^^^^^^^^ the item `aux_issue_121915` is already defined by the extern prelude
66
|
77
note: the lint level is defined here
88
--> $DIR/redundant-import-issue-121915.rs:4:8

0 commit comments

Comments
 (0)