Skip to content

Commit 60c49bc

Browse files
committed
Remove some dummy dependencies
1 parent 345ba50 commit 60c49bc

File tree

3 files changed

+3
-34
lines changed

3 files changed

+3
-34
lines changed

src/librustc/Cargo.toml

-30
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,3 @@ chalk-engine = { version = "0.9.0", default-features=false }
3737
rustc_fs_util = { path = "../librustc_fs_util" }
3838
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }
3939
measureme = "0.3"
40-
41-
# Note that these dependencies are a lie, they're just here to get linkage to
42-
# work.
43-
#
44-
# We're creating a bunch of dylibs for the compiler but we're also compiling a
45-
# bunch of crates.io crates. Everything in the compiler is compiled as an
46-
# rlib/dylib pair but all crates.io crates tend to just be rlibs. This means
47-
# we've got a problem for dependency graphs that look like:
48-
#
49-
# foo - rustc_codegen_llvm
50-
# / \
51-
# rustc ---- rustc_driver
52-
# \ /
53-
# foo - rustc_metadata
54-
#
55-
# Here the crate `foo` is linked into the `rustc_codegen_llvm` and the
56-
# `rustc_metadata` dylibs, meaning we've got duplicate copies! When we then
57-
# go to link `rustc_driver` the compiler notices this and gives us a compiler
58-
# error.
59-
#
60-
# To work around this problem we just add these crates.io dependencies to the
61-
# `rustc` crate which is a shared dependency above. That way the crate `foo`
62-
# shows up in the dylib for the `rustc` crate, deduplicating it and allowing
63-
# crates like `rustc_codegen_llvm` to use `foo` *through* the `rustc` crate.
64-
#
65-
# tl;dr; this is not needed to get `rustc` to compile, but if you remove it then
66-
# later crate stop compiling. If you can remove this and everything
67-
# compiles, then please feel free to do so!
68-
flate2 = "1.0"
69-
tempfile = "3.0"

src/librustc/lib.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,8 @@ extern crate serialize as rustc_serialize;
8989

9090
#[macro_use] extern crate smallvec;
9191

92-
// Note that librustc doesn't actually depend on these crates, see the note in
93-
// `Cargo.toml` for this crate about why these are here.
94-
#[allow(unused_extern_crates)]
95-
extern crate flate2;
92+
// Use the test crate here so we depend on getopts through it. This allow tools to link to both
93+
// librustc_driver and libtest.
9694
#[allow(unused_extern_crates)]
9795
extern crate test;
9896

src/librustc_codegen_llvm/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ test = false
1313
[dependencies]
1414
cc = "1.0.1" # Used to locate MSVC
1515
num_cpus = "1.0"
16+
tempfile = "3.0"
1617
rustc-demangle = "0.1.15"
1718
rustc_llvm = { path = "../librustc_llvm" }
1819
memmap = "0.6"

0 commit comments

Comments
 (0)