fix invalid unresolved imports
errors the asterisk wildcard syntax causes
use a path variabale
This commit is contained in:
parent
06460fe72c
commit
068a233d4d
5 changed files with 31 additions and 1 deletions
|
@ -720,7 +720,9 @@ impl<'a, 'b> ImportResolver<'a, 'b> {
|
|||
note: Vec::new(),
|
||||
suggestion: None,
|
||||
};
|
||||
errors.push((path, err));
|
||||
if path.contains("::") {
|
||||
errors.push((path, err))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
6
src/test/ui/rust-2018/unresolved-asterisk-imports.rs
Normal file
6
src/test/ui/rust-2018/unresolved-asterisk-imports.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
// edition:2018
|
||||
|
||||
use not_existing_crate::*; //~ ERROR unresolved import `not_existing_crate
|
||||
use std as foo;
|
||||
|
||||
fn main() {}
|
9
src/test/ui/rust-2018/unresolved-asterisk-imports.stderr
Normal file
9
src/test/ui/rust-2018/unresolved-asterisk-imports.stderr
Normal 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`.
|
4
src/test/ui/unresolved/unresolved-asterisk-imports.rs
Normal file
4
src/test/ui/unresolved/unresolved-asterisk-imports.rs
Normal file
|
@ -0,0 +1,4 @@
|
|||
use not_existing_crate::*; //~ ERROR unresolved import `not_existing_crate
|
||||
use std as foo;
|
||||
|
||||
fn main() {}
|
|
@ -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`.
|
Loading…
Add table
Reference in a new issue