rust/tests/ui/resolve/extern-prelude-fail.stderr
Esteban Küber b61570ac11 Structured suggestion for extern crate foo when foo isn't resolved in import
When encountering a name in an import that could have come from a crate that wasn't imported, use a structured suggestion to suggest `extern crate foo;` pointing at the right place in the crate.

When encountering `_` in an import, do not suggest `extern crate _;`.

```
error[E0432]: unresolved import `spam`
  --> $DIR/import-from-missing-star-3.rs:2:9
   |
LL |     use spam::*;
   |         ^^^^ maybe a missing crate `spam`?
   |
help: consider importing the `spam` crate
   |
LL + extern crate spam;
   |
```
2024-07-29 23:49:51 +00:00

27 lines
799 B
Plaintext

error[E0432]: unresolved import `extern_prelude`
--> $DIR/extern-prelude-fail.rs:7:9
|
LL | use extern_prelude::S;
| ^^^^^^^^^^^^^^ you might be missing crate `extern_prelude`
|
help: consider importing the `extern_prelude` crate
|
LL + extern crate extern_prelude;
|
error[E0433]: failed to resolve: you might be missing crate `extern_prelude`
--> $DIR/extern-prelude-fail.rs:8:15
|
LL | let s = ::extern_prelude::S;
| ^^^^^^^^^^^^^^ you might be missing crate `extern_prelude`
|
help: consider importing the `extern_prelude` crate
|
LL + extern crate extern_prelude;
|
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.