Skip to content

Implicit standard library dependencies #5003

Open
@Ericson2314

Description

@Ericson2314

(Split from of rust-lang/rfcs#1133)

Assuming #5002 shakes out in some fashion, we need to elaborate crates without explicit standard library dependencies to have them, so they can be practically used together with crates that do.

https://github.com/Ericson2314/rust-rfcs/blob/cargo-libstd/text/0000-cargo-libstd-awareness.md#implicit-dependencies was the section that covered this in my old RFC. I think it still reads fine but I'll double check and port over.

Key points to think about in any even

  1. Any explicit stdlib deps at all means no implicit deps. Otherwise hard to reason about / teach. This is a simplification of what I proposed in the RFC.
  2. Need additional way to opt-out for core, as it has no dependencies whatsoever.
  3. All components (library, exes, tests, benches) get an implicit std dependency. (That would be all 3 of [dependencies] [dev-dependencies] and [build-dependencies].
  4. Would be cleaner to to do explicit core deps, but our hands our probably tied by back-compat.
  5. test is a bit tricky because of the way it interacts with the built-in test harness. Ideally IMO they would both be normal crates, the harness a procedural macro of sorts. I don't want to grandfather in test being the only dep needed for both, precluding making the test-harness macro crate down the road.

CC @japaric @nrc

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-triageStatus: This issue is waiting on initial triage.Z-build-stdNightly: build-std

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions