]> git.lizzy.rs Git - rust.git/blob - library/rustc-std-workspace-core/README.md
Merge commit '5034d47f721ff4c3a3ff2aca9ef2ef3e1d067f9f' into clippyup
[rust.git] / library / rustc-std-workspace-core / README.md
1 # The `rustc-std-workspace-core` crate
2
3 This crate is a shim and empty crate which simply depends on `libcore` and
4 reexports all of its contents. The crate is the crux of empowering the standard
5 library to depend on crates from crates.io
6
7 Crates on crates.io that the standard library depend on the
8 `rustc-std-workspace-core` crate from crates.io. On crates.io, however, this
9 crate is empty. We use `[patch]` to override it to this crate in this
10 repository. As a result, crates on crates.io will draw a dependency edge to
11 `libcore`, the version defined in this repository. That should draw all the
12 dependency edges to ensure Cargo builds crates successfully!
13
14 Note that crates on crates.io need to depend on this crate with the name `core`
15 for everything to work correctly. To do that they can use:
16
17 ```toml
18 core = { version = "1.0.0", optional = true, package = 'rustc-std-workspace-core' }
19 ```
20
21 Through the use of the `package` key the crate is renamed to `core`, meaning
22 it'll look like
23
24 ```
25 --extern core=.../librustc_std_workspace_core-XXXXXXX.rlib
26 ```
27
28 when Cargo invokes the compiler, satisfying the implicit `extern crate core`
29 directive injected by the compiler.