diff --git a/src/librustc/Cargo.toml b/src/librustc/Cargo.toml index 7584df82ac6..b6f3bc62dfd 100644 --- a/src/librustc/Cargo.toml +++ b/src/librustc/Cargo.toml @@ -37,33 +37,3 @@ chalk-engine = { version = "0.9.0", default-features=false } rustc_fs_util = { path = "../librustc_fs_util" } smallvec = { version = "0.6.7", features = ["union", "may_dangle"] } measureme = "0.3" - -# Note that these dependencies are a lie, they're just here to get linkage to -# work. -# -# We're creating a bunch of dylibs for the compiler but we're also compiling a -# bunch of crates.io crates. Everything in the compiler is compiled as an -# rlib/dylib pair but all crates.io crates tend to just be rlibs. This means -# we've got a problem for dependency graphs that look like: -# -# foo - rustc_codegen_llvm -# / \ -# rustc ---- rustc_driver -# \ / -# foo - rustc_metadata -# -# Here the crate `foo` is linked into the `rustc_codegen_llvm` and the -# `rustc_metadata` dylibs, meaning we've got duplicate copies! When we then -# go to link `rustc_driver` the compiler notices this and gives us a compiler -# error. -# -# To work around this problem we just add these crates.io dependencies to the -# `rustc` crate which is a shared dependency above. That way the crate `foo` -# shows up in the dylib for the `rustc` crate, deduplicating it and allowing -# crates like `rustc_codegen_llvm` to use `foo` *through* the `rustc` crate. -# -# tl;dr; this is not needed to get `rustc` to compile, but if you remove it then -# later crate stop compiling. If you can remove this and everything -# compiles, then please feel free to do so! -flate2 = "1.0" -tempfile = "3.0" diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 8bedbefc0a6..dc26140ace5 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -89,10 +89,8 @@ extern crate serialize as rustc_serialize; #[macro_use] extern crate smallvec; -// Note that librustc doesn't actually depend on these crates, see the note in -// `Cargo.toml` for this crate about why these are here. -#[allow(unused_extern_crates)] -extern crate flate2; +// Use the test crate here so we depend on getopts through it. This allow tools to link to both +// librustc_driver and libtest. #[allow(unused_extern_crates)] extern crate test; diff --git a/src/librustc_codegen_llvm/Cargo.toml b/src/librustc_codegen_llvm/Cargo.toml index 4ae8303c76d..291d32a0681 100644 --- a/src/librustc_codegen_llvm/Cargo.toml +++ b/src/librustc_codegen_llvm/Cargo.toml @@ -13,6 +13,7 @@ test = false [dependencies] cc = "1.0.1" # Used to locate MSVC num_cpus = "1.0" +tempfile = "3.0" rustc-demangle = "0.1.15" rustc_llvm = { path = "../librustc_llvm" } memmap = "0.6"