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 to rustc to specify explicit dependencies to add to the extern prelude, even for pre-built artifacts. This can help obviate the need for extern crate for crates like proc-macro.
- We may also consider this to be implicit in some cases. For example, proc-macro could be automatically added with
proc-macro = true.
There have been a few different proposals for syntax, please see the following:
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.
This issue is for tracking the writing of an RFC for extending
Cargo.tomlto specify dependencies on standard library crates.There are a few needs and requirements:
--extern=footorustcto specify explicit dependencies to add to the extern prelude, even for pre-built artifacts. This can help obviate the need forextern cratefor crates likeproc-macro.proc-macro = true.There have been a few different proposals for syntax, please see the following:
extern cratefor sysroot cratesSome issues to consider: