5de8e6edfc
When both `std::` and `core::` items are available, only suggest the `std::` ones. We ensure that in `no_std` crates we suggest `core::` items. Ensure that the list of items suggested to be imported are always in the order of local crate items, `std`/`core` items and finally foreign crate items. Tweak wording of import suggestion: if there are multiple items but they are all of the same kind, we use the kind name and not the generic "items". Fix #83564.
53 lines
1.4 KiB
Plaintext
53 lines
1.4 KiB
Plaintext
error[E0433]: failed to resolve: use of undeclared crate or module `st`
|
|
--> $DIR/crate-or-module-typo.rs:3:5
|
|
|
|
|
LL | use st::cell::Cell;
|
|
| ^^ use of undeclared crate or module `st`
|
|
|
|
|
help: there is a crate or module with a similar name
|
|
|
|
|
LL | use std::cell::Cell;
|
|
| ~~~
|
|
|
|
error[E0432]: unresolved import `bas`
|
|
--> $DIR/crate-or-module-typo.rs:11:5
|
|
|
|
|
LL | use bas::bar;
|
|
| ^^^ use of undeclared crate or module `bas`
|
|
|
|
|
help: there is a crate or module with a similar name
|
|
|
|
|
LL | use bar::bar;
|
|
| ~~~
|
|
|
|
error[E0433]: failed to resolve: use of undeclared crate or module `st`
|
|
--> $DIR/crate-or-module-typo.rs:14:10
|
|
|
|
|
LL | bar: st::cell::Cell<bool>
|
|
| ^^ use of undeclared crate or module `st`
|
|
|
|
|
help: there is a crate or module with a similar name
|
|
|
|
|
LL | bar: std::cell::Cell<bool>
|
|
| ~~~
|
|
help: consider importing this module
|
|
|
|
|
LL + use std::cell;
|
|
|
|
|
help: if you import `cell`, refer to it directly
|
|
|
|
|
LL - bar: st::cell::Cell<bool>
|
|
LL + bar: cell::Cell<bool>
|
|
|
|
|
|
|
error[E0433]: failed to resolve: function `bar` is not a crate or module
|
|
--> $DIR/crate-or-module-typo.rs:6:20
|
|
|
|
|
LL | pub fn bar() { bar::baz(); }
|
|
| ^^^ function `bar` is not a crate or module
|
|
|
|
error: aborting due to 4 previous errors
|
|
|
|
Some errors have detailed explanations: E0432, E0433.
|
|
For more information about an error, try `rustc --explain E0432`.
|