Open
Description
This issue is for tracking the writing of an RFC for extending Cargo.toml
to specify dependencies on standard library crates.
There are a few needs and requirements:
- Opt-in to building the standard library instead of using pre-built artifacts.
- Specifying alternate standard library implementations.
- Create a way for Cargo to pass
--extern=foo
torustc
to specify explicit dependencies to add to the extern prelude, even for pre-built artifacts. This can help obviate the need forextern crate
for crates likeproc-macro
.- We may also consider this to be implicit in some cases. For example, proc-macro could be automatically added with
proc-macro = true
.
- We may also consider this to be implicit in some cases. For example, proc-macro could be automatically added with
There have been a few different proposals for syntax, please see the following:
- RFC 1133 proposal
- RFC 2663 proposal
- #5002 — Explicit standard library dependencies
- #5003 — Implicit standard library dependencies
- #57288 — Tracking issue for no more
extern crate
for sysroot crates
Some issues to consider:
- How does cargo treat multiple crates in a graph declaring dependencies on the standard library?
- How to balance implicit vs explicit dependencies?
- How to express a dependency on a pre-built artifact vs building one from source.