Skip to content

Commit 36a185e

Browse files
committed
rustc: Remove dylib crate type from most rustc crates
Now that procedural macros no longer link transitively to libsyntax, this shouldn't be needed any more! This commit is an experiment in removing all dynamic libraries from rustc except for librustc_driver itself. Let's see how far we can get with that!
1 parent 2cb7cdc commit 36a185e

File tree

37 files changed

+17
-97
lines changed

37 files changed

+17
-97
lines changed

Cargo.lock

-13
Original file line numberDiff line numberDiff line change
@@ -2288,7 +2288,6 @@ name = "rustc_apfloat"
22882288
version = "0.0.0"
22892289
dependencies = [
22902290
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
2291-
"rustc_cratesio_shim 0.0.0",
22922291
"smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
22932292
]
22942293

@@ -2371,15 +2370,6 @@ dependencies = [
23712370
"syntax_pos 0.0.0",
23722371
]
23732372

2374-
[[package]]
2375-
name = "rustc_cratesio_shim"
2376-
version = "0.0.0"
2377-
dependencies = [
2378-
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
2379-
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
2380-
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
2381-
]
2382-
23832373
[[package]]
23842374
name = "rustc_data_structures"
23852375
version = "0.0.0"
@@ -2392,7 +2382,6 @@ dependencies = [
23922382
"rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
23932383
"rustc-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
23942384
"rustc-rayon-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
2395-
"rustc_cratesio_shim 0.0.0",
23962385
"serialize 0.0.0",
23972386
"smallvec 0.6.7 (registry+https://github.com/rust-lang/crates.io-index)",
23982387
"stable_deref_trait 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2439,7 +2428,6 @@ version = "0.0.0"
24392428
dependencies = [
24402429
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
24412430
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
2442-
"rustc_cratesio_shim 0.0.0",
24432431
"rustc_data_structures 0.0.0",
24442432
"serialize 0.0.0",
24452433
"syntax_pos 0.0.0",
@@ -2626,7 +2614,6 @@ version = "0.0.0"
26262614
dependencies = [
26272615
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
26282616
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
2629-
"rustc_cratesio_shim 0.0.0",
26302617
"rustc_data_structures 0.0.0",
26312618
"serialize 0.0.0",
26322619
]

src/libarena/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ version = "0.0.0"
66
[lib]
77
name = "arena"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
109

1110
[dependencies]
12-
rustc_data_structures = { path = "../librustc_data_structures" }
11+
rustc_data_structures = { path = "../librustc_data_structures" }

src/libfmt_macros/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ version = "0.0.0"
66
[lib]
77
name = "fmt_macros"
88
path = "lib.rs"
9-
crate-type = ["dylib"]

src/libgraphviz/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ version = "0.0.0"
66
[lib]
77
name = "graphviz"
88
path = "lib.rs"
9-
crate-type = ["dylib"]

src/librustc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version = "0.0.0"
66
[lib]
77
name = "rustc"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
9+
doctest = false
1010

1111
[dependencies]
1212
arena = { path = "../libarena" }

src/librustc_allocator/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ version = "0.0.0"
55

66
[lib]
77
path = "lib.rs"
8-
crate-type = ["dylib"]
98
test = false
109

1110
[dependencies]

src/librustc_apfloat/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@ path = "lib.rs"
99

1010
[dependencies]
1111
bitflags = "1.0"
12-
rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }
1312
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }

src/librustc_apfloat/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@
3737

3838
#![feature(nll)]
3939
#![feature(try_from)]
40-
// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
41-
#[allow(unused_extern_crates)]
42-
extern crate rustc_cratesio_shim;
4340

4441
#[macro_use]
4542
extern crate bitflags;

src/librustc_borrowck/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_borrowck"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
109
test = false
10+
doctest = false
1111

1212
[dependencies]
1313
log = "0.4"
@@ -17,4 +17,4 @@ graphviz = { path = "../libgraphviz" }
1717
rustc = { path = "../librustc" }
1818
rustc_mir = { path = "../librustc_mir" }
1919
rustc_errors = { path = "../librustc_errors" }
20-
rustc_data_structures = { path = "../librustc_data_structures" }
20+
rustc_data_structures = { path = "../librustc_data_structures" }

src/librustc_codegen_llvm/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ extern crate rustc_platform_intrinsics as intrinsics;
4747
extern crate rustc_codegen_utils;
4848
extern crate rustc_codegen_ssa;
4949
extern crate rustc_fs_util;
50+
extern crate rustc_driver;
5051

5152
#[macro_use] extern crate log;
5253
#[macro_use] extern crate syntax;

src/librustc_codegen_ssa/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_codegen_ssa"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
109
test = false
1110

1211
[dependencies]

src/librustc_codegen_utils/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_codegen_utils"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
109
test = false
1110

1211
[dependencies]

src/librustc_cratesio_shim/Cargo.toml

-25
This file was deleted.

src/librustc_cratesio_shim/src/lib.rs

-9
This file was deleted.

src/librustc_data_structures/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_data_structures"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
9+
doctest = false
1010

1111
[dependencies]
1212
ena = "0.11"
1313
log = "0.4"
14-
rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }
1514
serialize = { path = "../libserialize" }
1615
graphviz = { path = "../libgraphviz" }
1716
cfg-if = "0.1.2"

src/librustc_data_structures/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@ extern crate serialize;
4343
extern crate graphviz;
4444
extern crate smallvec;
4545

46-
// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
47-
#[allow(unused_extern_crates)]
48-
extern crate rustc_cratesio_shim;
49-
5046
pub use rustc_serialize::hex::ToHex;
5147

5248
#[macro_export]

src/librustc_errors/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,13 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_errors"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
9+
doctest = false
1010

1111
[dependencies]
1212
log = "0.4"
1313
serialize = { path = "../libserialize" }
1414
syntax_pos = { path = "../libsyntax_pos" }
1515
rustc_data_structures = { path = "../librustc_data_structures" }
16-
rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }
1716
unicode-width = "0.1.4"
1817
atty = "0.2"
1918
termcolor = "1.0"

src/librustc_fs_util/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_fs_util"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
109

1110
[dependencies]

src/librustc_incremental/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_incremental"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
9+
doctest = false
1010

1111
[dependencies]
1212
graphviz = { path = "../libgraphviz" }

src/librustc_lint/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_lint"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
109
test = false
1110

1211
[dependencies]

src/librustc_llvm/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
66
html_root_url = "https://doc.rust-lang.org/nightly/")]
77

8-
// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
9-
#[allow(unused_extern_crates)]
10-
extern crate rustc_cratesio_shim;
11-
128
// NOTE: This crate only exists to allow linking on mingw targets.
139

1410
/// Initialize targets enabled by the build script via `cfg(llvm_component = "...")`.

src/librustc_metadata/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_metadata"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
9+
doctest = false
1010

1111
[dependencies]
1212
flate2 = "1.0"

src/librustc_mir/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_mir"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
9+
doctest = false
1010

1111
[dependencies]
1212
arena = { path = "../libarena" }

src/librustc_passes/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_passes"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
109

1110
[dependencies]
1211
log = "0.4"

src/librustc_platform_intrinsics/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_platform_intrinsics"
88
path = "lib.rs"
9-
crate-type = ["dylib"]

src/librustc_plugin/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ build = false
77
[lib]
88
name = "rustc_plugin"
99
path = "lib.rs"
10-
crate-type = ["dylib"]
10+
doctest = false
1111

1212
[dependencies]
1313
rustc = { path = "../librustc" }

src/librustc_privacy/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_privacy"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
109

1110
[dependencies]
1211
rustc = { path = "../librustc" }
1312
rustc_typeck = { path = "../librustc_typeck" }
1413
syntax = { path = "../libsyntax" }
1514
syntax_pos = { path = "../libsyntax_pos" }
16-
rustc_data_structures = { path = "../librustc_data_structures" }
15+
rustc_data_structures = { path = "../librustc_data_structures" }

src/librustc_resolve/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_resolve"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
109
test = false
10+
doctest = false
1111

1212
[dependencies]
1313
bitflags = "1.0"

src/librustc_save_analysis/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_save_analysis"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
109

1110
[dependencies]
1211
log = "0.4"

src/librustc_target/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_target"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
109

1110
[dependencies]
1211
bitflags = "1.0"
1312
log = "0.4"
14-
rustc_cratesio_shim = { path = "../librustc_cratesio_shim" }
1513
rustc_data_structures = { path = "../librustc_data_structures" }
1614
serialize = { path = "../libserialize" }

src/librustc_target/lib.rs

-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@ extern crate serialize;
2424

2525
extern crate serialize as rustc_serialize; // used by deriving
2626

27-
// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
28-
#[allow(unused_extern_crates)]
29-
extern crate rustc_cratesio_shim;
30-
3127
#[macro_use]
3228
extern crate rustc_data_structures;
3329

src/librustc_traits/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_traits"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
109

1110
[dependencies]
1211
bitflags = "1.0"

src/librustc_typeck/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ version = "0.0.0"
66
[lib]
77
name = "rustc_typeck"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
109
test = false
10+
doctest = false
1111

1212
[dependencies]
1313
arena = { path = "../libarena" }

src/libserialize/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ version = "0.0.0"
66
[lib]
77
name = "serialize"
88
path = "lib.rs"
9-
crate-type = ["dylib", "rlib"]
109

1110
[dependencies]
1211
smallvec = { version = "0.6.7", features = ["union", "may_dangle"] }

src/libsyntax/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version = "0.0.0"
66
[lib]
77
name = "syntax"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
9+
doctest = false
1010

1111
[dependencies]
1212
bitflags = "1.0"

src/libsyntax_ext/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ version = "0.0.0"
66
[lib]
77
name = "syntax_ext"
88
path = "lib.rs"
9-
crate-type = ["dylib"]
9+
doctest = false
1010

1111
[dependencies]
1212
fmt_macros = { path = "../libfmt_macros" }

0 commit comments

Comments
 (0)