File tree 1 file changed +21
-0
lines changed
compiler/rustc_error_codes/src/error_codes
1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -11,3 +11,24 @@ extern crate cake_is_a_lie; // error: can't find crate for `cake_is_a_lie`
11
11
You need to link your code to the relevant crate in order to be able to use it
12
12
(through Cargo or the ` -L ` option of rustc example). Plugins are crates as
13
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
You can’t perform that action at this time.
0 commit comments