-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #60359 - petrochenkov:imperruse, r=estebank
resolve: Consider erroneous imports used to avoid duplicate diagnostics Supersedes #60295 Fixes #48244 r? @estebank
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// There should be *no* unused import errors. | ||
#![deny(unused_imports)] | ||
|
||
mod qux { | ||
fn quz() {} | ||
} | ||
|
||
use qux::quz; //~ ERROR function `quz` is private | ||
use qux::bar; //~ ERROR unresolved import `qux::bar` | ||
use foo::bar; //~ ERROR unresolved import `foo` | ||
|
||
fn main() {} |
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,22 @@ | ||
error[E0432]: unresolved import `qux::bar` | ||
--> $DIR/unresolved-imports-used.rs:9:5 | ||
| | ||
LL | use qux::bar; | ||
| ^^^^^^^^ no `bar` in `qux` | ||
|
||
error[E0432]: unresolved import `foo` | ||
--> $DIR/unresolved-imports-used.rs:10:5 | ||
| | ||
LL | use foo::bar; | ||
| ^^^ maybe a missing `extern crate foo;`? | ||
|
||
error[E0603]: function `quz` is private | ||
--> $DIR/unresolved-imports-used.rs:8:10 | ||
| | ||
LL | use qux::quz; | ||
| ^^^ | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
Some errors have detailed explanations: E0432, E0603. | ||
For more information about an error, try `rustc --explain E0432`. |