Skip to content

Commit

Permalink
Use public-dependencies in all sysroot crates
Browse files Browse the repository at this point in the history
In [1], most dependencies of `std` and other sysroot crates were marked
private, but this did not happen for `alloc` and `test`. Update these
here, marking public standard library crates as the only non-private
dependencies.

[1]: #111076
  • Loading branch information
tgross35 committed Jan 28, 2025
1 parent f1c2e39 commit b33490f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 3 additions & 1 deletion library/alloc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["public-dependency"]

[package]
name = "alloc"
version = "0.0.0"
Expand All @@ -9,7 +11,7 @@ autobenches = false
edition = "2021"

[dependencies]
core = { path = "../core" }
core = { path = "../core", public = true }
compiler_builtins = { version = "=0.1.143", features = ['rustc-dep-of-std'] }

[dev-dependencies]
Expand Down
8 changes: 5 additions & 3 deletions library/sysroot/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
cargo-features = ["public-dependency"]

[package]
name = "sysroot"
version = "0.0.0"
edition = "2021"

# this is a dummy crate to ensure that all required crates appear in the sysroot
[dependencies]
proc_macro = { path = "../proc_macro" }
proc_macro = { path = "../proc_macro", public = true }
profiler_builtins = { path = "../profiler_builtins", optional = true }
std = { path = "../std" }
test = { path = "../test" }
std = { path = "../std", public = true }
test = { path = "../test", public = true }

# Forward features to the `std` crate as necessary
[features]
Expand Down
6 changes: 4 additions & 2 deletions library/test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
cargo-features = ["public-dependency"]

[package]
name = "test"
version = "0.0.0"
edition = "2021"

[dependencies]
getopts = { version = "0.2.21", features = ['rustc-dep-of-std'] }
std = { path = "../std" }
core = { path = "../core" }
std = { path = "../std", public = true }
core = { path = "../core", public = true }

[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
libc = { version = "0.2.150", default-features = false }

0 comments on commit b33490f

Please sign in to comment.