-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix redundant import errors for preload extern crate
- Loading branch information
1 parent
bdde2a8
commit 74ed601
Showing
17 changed files
with
113 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub fn item() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//@ compile-flags: --extern aux_issue_121915 --edition 2015 | ||
//@ aux-build: aux-issue-121915.rs | ||
|
||
extern crate aux_issue_121915; | ||
|
||
#[deny(unused_imports)] | ||
fn main() { | ||
use aux_issue_121915; | ||
//~^ ERROR the item `aux_issue_121915` is imported redundantly | ||
aux_issue_121915::item(); | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/ui/imports/redundant-import-issue-121915-2015.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error: the item `aux_issue_121915` is imported redundantly | ||
--> $DIR/redundant-import-issue-121915-2015.rs:8:9 | ||
| | ||
LL | extern crate aux_issue_121915; | ||
| ------------------------------ the item `aux_issue_121915` is already imported here | ||
... | ||
LL | use aux_issue_121915; | ||
| ----^^^^^^^^^^^^^^^^- help: remove this import | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/redundant-import-issue-121915-2015.rs:6:8 | ||
| | ||
LL | #[deny(unused_imports)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//@ compile-flags: --extern aux_issue_121915 --edition 2018 | ||
//@ aux-build: aux-issue-121915.rs | ||
|
||
#[deny(unused_imports)] | ||
fn main() { | ||
use aux_issue_121915; | ||
//~^ ERROR the item `aux_issue_121915` is imported redundantly | ||
aux_issue_121915::item(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error: the item `aux_issue_121915` is imported redundantly | ||
--> $DIR/redundant-import-issue-121915.rs:6:9 | ||
| | ||
LL | use aux_issue_121915; | ||
| ----^^^^^^^^^^^^^^^^- | ||
| | | | ||
| | the item `aux_issue_121915` is already defined by prelude | ||
| help: remove this import | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/redundant-import-issue-121915.rs:4:8 | ||
| | ||
LL | #[deny(unused_imports)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//@ run-rustfix | ||
//@ compile-flags: --edition 2021 | ||
#[deny(unused_imports)] | ||
//~^ ERROR the item `TryFrom` is imported redundantly | ||
|
||
fn main() { | ||
let _ = u32::try_from(5i32); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//@ run-rustfix | ||
//@ compile-flags: --edition 2021 | ||
#[deny(unused_imports)] | ||
use std::convert::TryFrom; | ||
//~^ ERROR the item `TryFrom` is imported redundantly | ||
|
||
fn main() { | ||
let _ = u32::try_from(5i32); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error: the item `TryFrom` is imported redundantly | ||
--> $DIR/suggest-remove-issue-121315.rs:4:5 | ||
| | ||
LL | use std::convert::TryFrom; | ||
| ----^^^^^^^^^^^^^^^^^^^^^- help: remove this import | ||
--> $SRC_DIR/std/src/prelude/mod.rs:LL:COL | ||
| | ||
= note: the item `TryFrom` is already defined here | ||
| | ||
note: the lint level is defined here | ||
--> $DIR/suggest-remove-issue-121315.rs:3:8 | ||
| | ||
LL | #[deny(unused_imports)] | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters