Skip to content

Commit 788016a

Browse files
authoredFeb 3, 2021
Rollup merge of rust-lang#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.
2 parents f52080c + 82914a5 commit 788016a

File tree

1 file changed

+21
-0
lines changed
  • compiler/rustc_error_codes/src/error_codes

1 file changed

+21
-0
lines changed
 

‎compiler/rustc_error_codes/src/error_codes/E0463.md

+21
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,24 @@ extern crate cake_is_a_lie; // error: can't find crate for `cake_is_a_lie`
1111
You need to link your code to the relevant crate in order to be able to use it
1212
(through Cargo or the `-L` option of rustc example). Plugins are crates as
1313
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

0 commit comments

Comments
 (0)
Please sign in to comment.