fix invalid unresolved imports errors the asterisk wildcard syntax causes

use a path variabale
This commit is contained in:
Takayuki Maeda 2022-03-04 13:07:39 +09:00
parent 06460fe72c
commit 068a233d4d
5 changed files with 31 additions and 1 deletions

View file

@ -720,7 +720,9 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
note: Vec::new(), note: Vec::new(),
suggestion: None, suggestion: None,
}; };
errors.push((path, err)); if path.contains("::") {
errors.push((path, err))
}
} }
} }

View file

@ -0,0 +1,6 @@
// edition:2018
use not_existing_crate::*; //~ ERROR unresolved import `not_existing_crate
use std as foo;
fn main() {}

View file

@ -0,0 +1,9 @@
error[E0432]: unresolved import `not_existing_crate`
--> $DIR/unresolved-asterisk-imports.rs:3:5
|
LL | use not_existing_crate::*;
| ^^^^^^^^^^^^^^^^^^ use of undeclared crate or module `not_existing_crate`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0432`.

View file

@ -0,0 +1,4 @@
use not_existing_crate::*; //~ ERROR unresolved import `not_existing_crate
use std as foo;
fn main() {}

View file

@ -0,0 +1,9 @@
error[E0432]: unresolved import `not_existing_crate`
--> $DIR/unresolved-asterisk-imports.rs:1:5
|
LL | use not_existing_crate::*;
| ^^^^^^^^^^^^^^^^^^ maybe a missing crate `not_existing_crate`?
error: aborting due to previous error
For more information about this error, try `rustc --explain E0432`.