Skip to content

Commit 535f9e7

Browse files
committed
Remove some dummy dependencies
1 parent 6250c82 commit 535f9e7

File tree

5 files changed

+4
-38
lines changed

5 files changed

+4
-38
lines changed

Cargo.lock

+1-2
Original file line numberDiff line numberDiff line change
@@ -2320,7 +2320,6 @@ dependencies = [
23202320
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
23212321
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
23222322
"chalk-engine 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
2323-
"flate2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
23242323
"fmt_macros 0.0.0",
23252324
"graphviz 0.0.0",
23262325
"jobserver 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2342,7 +2341,6 @@ dependencies = [
23422341
"smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
23432342
"syntax 0.0.0",
23442343
"syntax_pos 0.0.0",
2345-
"tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
23462344
]
23472345

23482346
[[package]]
@@ -2585,6 +2583,7 @@ dependencies = [
25852583
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
25862584
"rustc-demangle 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
25872585
"rustc_llvm 0.0.0",
2586+
"tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
25882587
]
25892588

25902589
[[package]]

src/librustc/Cargo.toml

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

src/librustc/lib.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
3030

3131
#![deny(rust_2018_idioms)]
32-
#![cfg_attr(not(stage0), deny(internal))]
3332
#![allow(explicit_outlives_requirements)]
3433

3534
#![feature(arbitrary_self_types)]
@@ -85,10 +84,8 @@ extern crate serialize as rustc_serialize;
8584

8685
#[macro_use] extern crate smallvec;
8786

88-
// Note that librustc doesn't actually depend on these crates, see the note in
89-
// `Cargo.toml` for this crate about why these are here.
90-
#[allow(unused_extern_crates)]
91-
extern crate flate2;
87+
// Use the test crate here so we depend on getopts through it. This allow tools to link to both
88+
// librustc_driver and libtest.
9289
#[allow(unused_extern_crates)]
9390
extern crate test;
9491

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.4"
1718
rustc_llvm = { path = "../librustc_llvm" }
1819
memmap = "0.6"

src/librustc_codegen_llvm/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ extern crate rustc_driver as _;
4646
extern crate syntax_pos;
4747
extern crate rustc_errors as errors;
4848
extern crate serialize;
49-
extern crate tempfile;
5049

5150
use rustc_codegen_ssa::traits::*;
5251
use rustc_codegen_ssa::back::write::{CodegenContext, ModuleConfig, FatLTOInput};

0 commit comments

Comments
 (0)