Repository: rust
Issue: Tracking issue for RFC 1977: public & private dependencies
Labels: B-RFC-approved,E-help-wanted,T-cargo,C-tracking-issue,A-maybe-future-edition,S-tracking-impl-incomplete,S-tracking-design-concerns,S-tracking-needs-migration-lint,S-tracking-needs-documentation,F-public_private_dependencies

### Summary

RFC (original, superseded): [#1977](https://github.com/rust-lang/rfcs/pull/1977)
RFC: [#3516](https://github.com/rust-lang/rfcs/pull/3516)
Cargo tracking issue: https://github.com/rust-lang/cargo/issues/6129
Issues: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AF-public_private_dependencies
Cargo issues: https://github.com/rust-lang/cargo/issues?q=is%3Aopen+is%3Aissue+label%3AZ-public-dependency
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#public-dependency

This feature enables the ability to track which dependencies are publicly exposed through a library's interface. It has two sides to the implementation: rustc (lint and `--extern` flag), and cargo (`Cargo.toml` syntax, and passing `--extern` flags).

This feature was originally specified in rust-lang/rfcs#1977, but was later down-scoped in rust-lang/rfcs#3516.

### About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however *not* meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.

### Unresolved Questions

### Steps

- [ ] Implementation
  - [x] rust-lang/rust#57586
  - [x] rust-lang/rust#59335
  - [x] #67074 
  - [ ] #71043
  - [ ] #119428
  - [x] https://github.com/rust-lang/rust/pull/122665
  - [x] https://github.com/rust-lang/rust/pull/122757
  - [x] rust-lang/cargo#6653
  - [x] rust-lang/cargo#6772
  - [x] rust-lang/cargo#6962
  - [x] rust-lang/cargo#12817
  - [x] rust-lang/cargo#13039
  - [x] rust-lang/cargo#13036
  - [x] rust-lang/cargo#13037
  - [ ] rust-lang/cargo#13038
  - [x] rust-lang/cargo#13308
  - [x] rust-lang/cargo#14502
  - [ ] ~~Command to update Cargo.lock to minimal versions (rust-lang/cargo#4100)~~
  - [ ] ~~Make `cargo publish` use the minimal versions allowed by Cargo.toml~~
  - [ ] Ensure quality of error messages is sufficient
  - [ ] rust-lang/cargo#13095
  - [ ] Make `exported-private-dependencies` `allow`-by-default pre-2024 and `deny`-by-default in 2024+ / in the 2024-compatibility lint group
    - [ ] Perform a crater run and evaluate whether the pre-202x edition lint should be `allow` or `warn` ([context from zulip](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/RFC.20.233516.20-.20RFC.3A.20Superseding.20public.2Fprivate.20dependencies/near/419166799))
- [ ] Implement migration lints.
- [ ] Add documentation to the [edition guide][].
- [ ] Ensure ready for Rust 2024 stabilization.

[dev guide]: https://github.com/rust-lang/rustc-dev-guide
[doc-guide]: https://rustc-dev-guide.rust-lang.org/stabilization_guide.html#documentation-prs
[edition guide]: https://github.com/rust-lang/edition-guide
[nightly style procedure]: https://github.com/rust-lang/style-team/blob/master/nightly-style-procedure.md
[reference]: https://github.com/rust-lang/reference
[reference-instructions]: https://github.com/rust-lang/reference/blob/master/CONTRIBUTING.md
[style guide]: https://github.com/rust-lang/rust/tree/master/src/doc/style-guide

Non-blocking further improvements
- rust-lang/cargo#13096

### Changes from RFC

- RFC did not specify workspace inheritance behavior.  With rust-lang/cargo#13125, we disallow it.

cc @rust-lang/cargo @epage