diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2021-02-05 12:26:02 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-05 12:26:02 +0100 |
| commit | 29371c25044852300d7d2d87c2c25375fcc37173 (patch) | |
| tree | 8399abf855a7878bc2d356f9a49e82834883890c /compiler/rustc_error_codes | |
| parent | ce1020fc55d901838477ed5626c332c48ca16fd4 (diff) | |
| parent | 82914a503119b35b9fd0d33384136049bc6750cc (diff) | |
| download | rust-29371c25044852300d7d2d87c2c25375fcc37173.tar.gz rust-29371c25044852300d7d2d87c2c25375fcc37173.zip | |
Rollup merge of #81676 - jyn514:crate-not-found, r=oli-obk
Add more information to the error code for 'crate not found' This comes up a lot when bootstrapping.
Diffstat (limited to 'compiler/rustc_error_codes')
| -rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0463.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0463.md b/compiler/rustc_error_codes/src/error_codes/E0463.md index e46938c607d..d0cd1b1dcb7 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0463.md +++ b/compiler/rustc_error_codes/src/error_codes/E0463.md @@ -11,3 +11,24 @@ extern crate cake_is_a_lie; // error: can't find crate for `cake_is_a_lie` You need to link your code to the relevant crate in order to be able to use it (through Cargo or the `-L` option of rustc example). Plugins are crates as well, and you link to them the same way. + +## Common causes + +- The crate is not present at all. If using Cargo, add it to `[dependencies]` + in Cargo.toml. +- The crate is present, but under a different name. If using Cargo, look for + `package = ` under `[dependencies]` in Cargo.toml. + +## Common causes for missing `std` or `core` + +- You are cross-compiling for a target which doesn't have `std` prepackaged. + Consider one of the following: + + Adding a pre-compiled version of std with `rustup target add` + + Building std from source with `cargo build -Z build-std` + + Using `#![no_std]` at the crate root, so you won't need `std` in the first + place. +- You are developing the compiler itself and haven't built libstd from source. + You can usually build it with `x.py build library/std`. More information + about x.py is available in the [rustc-dev-guide]. + +[rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#building-the-compiler |
