Skip to content

Commit e5b0829

Browse files
committed
Auto merge of #39060 - jseyfried:improve_unused, r=nrc
Improve unused `extern crate` and unused `#[macro_use]` warnings This PR - adds `unused_imports` warnings for unused `#[macro_use] extern crate` macro imports, - improves `unused_extern_crates` warnings (avoids false negatives), and - removes unused `#[macro_use]` imports and unused `extern crate`s. r? @nrc
2 parents 1b06375 + 191abc4 commit e5b0829

File tree

38 files changed

+104
-127
lines changed

38 files changed

+104
-127
lines changed

src/Cargo.lock

-17
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/libproc_macro_plugin/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@ crate-type = ["dylib"]
1111
log = { path = "../liblog" }
1212
rustc_plugin = { path = "../librustc_plugin" }
1313
syntax = { path = "../libsyntax" }
14-
syntax_pos = { path = "../libsyntax_pos" }
1514
proc_macro_tokens = { path = "../libproc_macro_tokens" }

src/libproc_macro_plugin/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888

8989
extern crate rustc_plugin;
9090
extern crate syntax;
91-
extern crate syntax_pos;
9291
extern crate proc_macro_tokens;
9392
#[macro_use] extern crate log;
9493

src/libproc_macro_tokens/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,3 @@ crate-type = ["dylib"]
1010

1111
[dependencies]
1212
syntax = { path = "../libsyntax" }
13-
syntax_pos = { path = "../libsyntax_pos" }
14-
log = { path = "../liblog" }

src/libproc_macro_tokens/build.rs

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
extern crate syntax;
12-
extern crate syntax_pos;
13-
1411
use syntax::ast::Ident;
1512
use syntax::codemap::DUMMY_SP;
1613
use syntax::parse::token::{self, Token};

src/libproc_macro_tokens/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@
5858
#![feature(rustc_private)]
5959

6060
extern crate syntax;
61-
extern crate syntax_pos;
62-
#[macro_use] extern crate log;
6361

6462
pub mod build;
6563
pub mod parse;

src/libproc_macro_tokens/parse.rs

-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010

1111
//! Parsing utilities for writing procedural macros.
1212
13-
extern crate syntax;
14-
1513
use syntax::parse::{ParseSess, filemap_to_tts};
1614
use syntax::tokenstream::TokenStream;
1715

src/librustc/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ crate-type = ["dylib"]
1010

1111
[dependencies]
1212
arena = { path = "../libarena" }
13-
flate = { path = "../libflate" }
1413
fmt_macros = { path = "../libfmt_macros" }
1514
graphviz = { path = "../libgraphviz" }
1615
log = { path = "../liblog" }

src/librustc/lib.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#![feature(associated_consts)]
2727
#![feature(box_patterns)]
2828
#![feature(box_syntax)]
29-
#![feature(collections)]
3029
#![feature(conservative_impl_trait)]
3130
#![feature(const_fn)]
3231
#![feature(core_intrinsics)]
@@ -39,11 +38,9 @@
3938
#![feature(slice_patterns)]
4039
#![feature(staged_api)]
4140
#![feature(unboxed_closures)]
42-
#![cfg_attr(test, feature(test))]
4341

4442
extern crate arena;
4543
extern crate core;
46-
extern crate flate;
4744
extern crate fmt_macros;
4845
extern crate getopts;
4946
extern crate graphviz;
@@ -52,22 +49,18 @@ extern crate rustc_llvm as llvm;
5249
extern crate rustc_back;
5350
extern crate rustc_data_structures;
5451
extern crate serialize;
55-
extern crate collections;
5652
extern crate rustc_const_math;
5753
extern crate rustc_errors as errors;
5854
#[macro_use] extern crate log;
5955
#[macro_use] extern crate syntax;
60-
#[macro_use] extern crate syntax_pos;
56+
extern crate syntax_pos;
6157
#[macro_use] #[no_link] extern crate rustc_bitflags;
6258

6359
extern crate serialize as rustc_serialize; // used by deriving
6460

6561
// SNAP:
6662
extern crate rustc_i128;
6763

68-
#[cfg(test)]
69-
extern crate test;
70-
7164
#[macro_use]
7265
mod macros;
7366

src/librustc_const_eval/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ crate-type = ["dylib"]
1111
[dependencies]
1212
arena = { path = "../libarena" }
1313
log = { path = "../liblog" }
14-
serialize = { path = "../libserialize" }
1514
rustc = { path = "../librustc" }
1615
rustc_back = { path = "../librustc_back" }
1716
rustc_const_math = { path = "../librustc_const_math" }

src/librustc_const_eval/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ extern crate rustc_data_structures;
4040
extern crate rustc_errors;
4141
extern crate graphviz;
4242
extern crate syntax_pos;
43-
extern crate serialize as rustc_serialize; // used by deriving
4443

4544
extern crate rustc_i128;
4645

src/librustc_const_math/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ path = "lib.rs"
99
crate-type = ["dylib"]
1010

1111
[dependencies]
12-
log = { path = "../liblog" }
1312
serialize = { path = "../libserialize" }
1413
syntax = { path = "../libsyntax" }
1514
rustc_i128 = { path = "../librustc_i128" }

src/librustc_const_math/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@
2828
#![feature(const_fn)]
2929
#![cfg_attr(not(stage0), feature(i128))]
3030

31-
#[macro_use] extern crate log;
32-
#[macro_use] extern crate syntax;
31+
extern crate syntax;
3332

3433
// SNAP: remove use of this crate
3534
extern crate rustc_i128;

src/librustc_driver/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ crate-type = ["dylib"]
1010

1111
[dependencies]
1212
arena = { path = "../libarena" }
13-
flate = { path = "../libflate" }
1413
graphviz = { path = "../libgraphviz" }
1514
log = { path = "../liblog" }
1615
proc_macro_plugin = { path = "../libproc_macro_plugin" }

src/librustc_driver/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
#![feature(staged_api)]
3333

3434
extern crate arena;
35-
extern crate flate;
3635
extern crate getopts;
3736
extern crate graphviz;
3837
extern crate libc;
@@ -57,7 +56,6 @@ extern crate serialize;
5756
extern crate rustc_llvm as llvm;
5857
#[macro_use]
5958
extern crate log;
60-
#[macro_use]
6159
extern crate syntax;
6260
extern crate syntax_ext;
6361
extern crate syntax_pos;

src/librustc_errors/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,4 @@ path = "lib.rs"
99
crate-type = ["dylib"]
1010

1111
[dependencies]
12-
log = { path = "../liblog" }
13-
serialize = { path = "../libserialize" }
1412
syntax_pos = { path = "../libsyntax_pos" }

src/librustc_errors/lib.rs

-7
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,9 @@
2323
#![feature(staged_api)]
2424
#![feature(range_contains)]
2525
#![feature(libc)]
26-
#![feature(unicode)]
2726

28-
extern crate serialize;
2927
extern crate term;
30-
#[macro_use]
31-
extern crate log;
32-
#[macro_use]
3328
extern crate libc;
34-
extern crate std_unicode;
35-
extern crate serialize as rustc_serialize; // used by deriving
3629
extern crate syntax_pos;
3730

3831
pub use emitter::ColorConfig;

src/librustc_incremental/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,3 @@ serialize = { path = "../libserialize" }
1616
log = { path = "../liblog" }
1717
syntax = { path = "../libsyntax" }
1818
syntax_pos = { path = "../libsyntax_pos" }
19-
rustc_i128 = { path = "../librustc_i128" }

src/librustc_incremental/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ extern crate rustc_data_structures;
3030
extern crate serialize as rustc_serialize;
3131

3232
#[macro_use] extern crate log;
33-
#[macro_use] extern crate syntax;
33+
extern crate syntax;
3434
extern crate syntax_pos;
3535

36-
extern crate rustc_i128;
37-
3836
const ATTR_DIRTY: &'static str = "rustc_dirty";
3937
const ATTR_CLEAN: &'static str = "rustc_clean";
4038
const ATTR_DIRTY_METADATA: &'static str = "rustc_metadata_dirty";

src/librustc_lint/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
#![feature(slice_patterns)]
3838
#![feature(staged_api)]
3939

40-
#[macro_use]
4140
extern crate syntax;
4241
#[macro_use]
4342
extern crate rustc;

src/librustc_mir/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ crate-type = ["dylib"]
1212
graphviz = { path = "../libgraphviz" }
1313
log = { path = "../liblog" }
1414
rustc = { path = "../librustc" }
15-
rustc_back = { path = "../librustc_back" }
1615
rustc_const_eval = { path = "../librustc_const_eval" }
1716
rustc_const_math = { path = "../librustc_const_math" }
1817
rustc_data_structures = { path = "../librustc_data_structures" }

src/librustc_mir/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ extern crate graphviz as dot;
3131
#[macro_use]
3232
extern crate rustc;
3333
extern crate rustc_data_structures;
34-
extern crate rustc_back;
3534
#[macro_use]
3635
#[no_link]
3736
extern crate rustc_bitflags;

src/librustc_passes/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#![feature(staged_api)]
2828
#![feature(rustc_private)]
2929

30-
extern crate core;
3130
#[macro_use]
3231
extern crate rustc;
3332
extern crate rustc_const_eval;

src/librustc_plugin/Cargo.toml

-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ path = "lib.rs"
1010
crate-type = ["dylib"]
1111

1212
[dependencies]
13-
log = { path = "../liblog" }
1413
rustc = { path = "../librustc" }
1514
rustc_back = { path = "../librustc_back" }
16-
rustc_bitflags = { path = "../librustc_bitflags" }
1715
rustc_metadata = { path = "../librustc_metadata" }
1816
syntax = { path = "../libsyntax" }
1917
syntax_pos = { path = "../libsyntax_pos" }

src/librustc_plugin/lib.rs

-2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@
6363
#![feature(rustc_diagnostic_macros)]
6464
#![feature(rustc_private)]
6565

66-
#[macro_use] extern crate log;
6766
#[macro_use] extern crate syntax;
68-
#[macro_use] #[no_link] extern crate rustc_bitflags;
6967

7068
extern crate rustc;
7169
extern crate rustc_back;

0 commit comments

Comments
 (0)