]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0463.md
Rollup merge of #102215 - alexcrichton:wasm-link-whole-archive, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0463.md
1 A plugin/crate was declared but cannot be found.
2
3 Erroneous code example:
4
5 ```compile_fail,E0463
6 #![feature(plugin)]
7 #![plugin(cookie_monster)] // error: can't find crate for `cookie_monster`
8 extern crate cake_is_a_lie; // error: can't find crate for `cake_is_a_lie`
9 ```
10
11 You need to link your code to the relevant crate in order to be able to use it
12 (through Cargo or the `-L` option of rustc example). Plugins are crates as
13 well, and you link to them the same way.
14
15 ## Common causes
16
17 - The crate is not present at all. If using Cargo, add it to `[dependencies]`
18   in Cargo.toml.
19 - The crate is present, but under a different name. If using Cargo, look for
20   `package = ` under `[dependencies]` in Cargo.toml.
21
22 ## Common causes for missing `std` or `core`
23
24 - You are cross-compiling for a target which doesn't have `std` prepackaged.
25   Consider one of the following:
26   + Adding a pre-compiled version of std with `rustup target add`
27   + Building std from source with `cargo build -Z build-std`
28   + Using `#![no_std]` at the crate root, so you won't need `std` in the first
29     place.
30 - You are developing the compiler itself and haven't built libstd from source.
31   You can usually build it with `x.py build library/std`. More information
32   about x.py is available in the [rustc-dev-guide].
33
34 [rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#building-the-compiler