Skip to content

Commit

Permalink
Make libstd depend on the hashbrown crate
Browse files Browse the repository at this point in the history
  • Loading branch information
Amanieu committed Apr 23, 2019
1 parent 556fc40 commit 1fa7a21
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 0 deletions.
19 changes: 19 additions & 0 deletions Cargo.lock
Expand Up @@ -1066,6 +1066,16 @@ dependencies = [
"walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "hashbrown"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"compiler_builtins 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-std-workspace-alloc 1.0.0",
"rustc-std-workspace-core 1.0.0",
]

[[package]]
name = "heck"
version = "0.3.0"
Expand Down Expand Up @@ -2529,6 +2539,13 @@ name = "rustc-serialize"
version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"

[[package]]
name = "rustc-std-workspace-alloc"
version = "1.0.0"
dependencies = [
"alloc 0.0.0",
]

[[package]]
name = "rustc-std-workspace-core"
version = "1.0.0"
Expand Down Expand Up @@ -3260,6 +3277,7 @@ dependencies = [
"core 0.0.0",
"dlmalloc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fortanix-sgx-abi 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hashbrown 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
"panic_abort 0.0.0",
"panic_unwind 0.0.0",
Expand Down Expand Up @@ -4103,6 +4121,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum globset 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4743617a7464bbda3c8aec8558ff2f9429047e025771037df561d383337ff865"
"checksum handlebars 0.32.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d89ec99d1594f285d4590fc32bac5f75cdab383f1123d504d27862c644a807dd"
"checksum handlebars 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d82e5750d8027a97b9640e3fefa66bbaf852a35228e1c90790efd13c4b09c166"
"checksum hashbrown 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "58623735fa622916205f9e0a52a031b25b0e251ddaef47f7cb288444c4410beb"
"checksum heck 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea04fa3ead4e05e51a7c806fc07271fdbde4e246a6c6d1efd52e72230b771b82"
"checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77"
"checksum home 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "80dff82fb58cfbbc617fb9a9184b010be0529201553cda50ad04372bc2333aff"
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -67,6 +67,7 @@ rustc-workspace-hack = { path = 'src/tools/rustc-workspace-hack' }
# See comments in `tools/rustc-std-workspace-core/README.md` for what's going on
# here
rustc-std-workspace-core = { path = 'src/tools/rustc-std-workspace-core' }
rustc-std-workspace-alloc = { path = 'src/tools/rustc-std-workspace-alloc' }

[patch."https://github.com/rust-lang/rust-clippy"]
clippy_lints = { path = "src/tools/clippy/clippy_lints" }
1 change: 1 addition & 0 deletions src/libstd/Cargo.toml
Expand Up @@ -22,6 +22,7 @@ libc = { version = "0.2.51", default-features = false, features = ['rustc-dep-of
compiler_builtins = { version = "0.1.9" }
profiler_builtins = { path = "../libprofiler_builtins", optional = true }
unwind = { path = "../libunwind" }
hashbrown = { version = "0.2.0", features = ['rustc-dep-of-std'] }
rustc-demangle = { version = "0.1.10", features = ['rustc-dep-of-std'] }
backtrace-sys = { version = "0.1.24", features = ["rustc-dep-of-std"], optional = true }

Expand Down
14 changes: 14 additions & 0 deletions src/tools/rustc-std-workspace-alloc/Cargo.toml
@@ -0,0 +1,14 @@
[package]
name = "rustc-std-workspace-alloc"
version = "1.0.0"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
license = 'MIT/Apache-2.0'
description = """
Hack for the compiler's own build system
"""

[lib]
path = "lib.rs"

[dependencies]
alloc = { path = "../../liballoc" }
9 changes: 9 additions & 0 deletions src/tools/rustc-std-workspace-alloc/lib.rs
@@ -0,0 +1,9 @@
#![feature(no_core, alloc)]
#![no_core]

// See rustc-std-workspace-core for why this crate is needed.

// Rename the crate to avoid conflicting with the alloc module in liballoc.
extern crate alloc as foo;

pub use foo::*;

0 comments on commit 1fa7a21

Please sign in to comment.