Skip to content

Commit f27f14b

Browse files
authored
Rollup merge of rust-lang#60671 - euclio:extern-crate, r=Centril
remove unneeded `extern crate`s from build tools
2 parents e7b4023 + b2f71fb commit f27f14b

28 files changed

+81
-75
lines changed

Cargo.lock

+36-40
Large diffs are not rendered by default.

src/bootstrap/Cargo.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ num_cpus = "1.0"
4242
getopts = "0.2.19"
4343
cc = "1.0.35"
4444
libc = "0.2"
45-
serde = "1.0.8"
46-
serde_derive = "1.0.8"
45+
serde = { version = "1.0.8", features = ["derive"] }
4746
serde_json = "1.0.2"
4847
toml = "0.4"
49-
lazy_static = "0.2"
48+
lazy_static = "1.3.0"
5049
time = "0.1"
5150
petgraph = "0.4.13"
5251

src/bootstrap/builder.rs

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use std::path::{Path, PathBuf};
1111
use std::process::Command;
1212
use std::time::{Duration, Instant};
1313

14+
use build_helper::t;
15+
1416
use crate::cache::{Cache, Interned, INTERNER};
1517
use crate::check;
1618
use crate::compile;
@@ -1308,6 +1310,8 @@ mod __test {
13081310
use crate::config::Config;
13091311
use std::thread;
13101312

1313+
use pretty_assertions::assert_eq;
1314+
13111315
fn configure(host: &[&str], target: &[&str]) -> Config {
13121316
let mut config = Config::default_opts();
13131317
// don't save toolstates

src/bootstrap/cache.rs

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ use std::path::{Path, PathBuf};
1313
use std::sync::Mutex;
1414
use std::cmp::{PartialOrd, Ord, Ordering};
1515

16+
use lazy_static::lazy_static;
17+
1618
use crate::builder::Step;
1719

1820
pub struct Interned<T>(usize, PhantomData<*const T>);

src/bootstrap/clean.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ use std::fs;
99
use std::io::{self, ErrorKind};
1010
use std::path::Path;
1111

12+
use build_helper::t;
13+
1214
use crate::Build;
1315

1416
pub fn clean(build: &Build, all: bool) {

src/bootstrap/compile.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ use std::path::{Path, PathBuf};
1515
use std::process::{Command, Stdio, exit};
1616
use std::str;
1717

18-
use build_helper::{output, mtime, up_to_date};
18+
use build_helper::{output, mtime, t, up_to_date};
1919
use filetime::FileTime;
20+
use serde::Deserialize;
2021
use serde_json;
2122

2223
use crate::dist;

src/bootstrap/config.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ use std::path::{Path, PathBuf};
1010
use std::process;
1111
use std::cmp;
1212

13+
use build_helper::t;
1314
use num_cpus;
1415
use toml;
16+
use serde::Deserialize;
1517
use crate::cache::{INTERNER, Interned};
1618
use crate::flags::Flags;
1719
pub use crate::flags::Subcommand;

src/bootstrap/dist.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::io::Write;
1414
use std::path::{PathBuf, Path};
1515
use std::process::{Command, Stdio};
1616

17-
use build_helper::output;
17+
use build_helper::{output, t};
1818

1919
use crate::{Compiler, Mode, LLVM_TOOLS};
2020
use crate::channel;

src/bootstrap/doc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::io;
1313
use std::path::{PathBuf, Path};
1414

1515
use crate::Mode;
16-
use build_helper::up_to_date;
16+
use build_helper::{t, up_to_date};
1717

1818
use crate::util::symlink_dir;
1919
use crate::builder::{Builder, Compiler, RunConfig, ShouldRun, Step};

src/bootstrap/install.rs

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ use std::fs;
88
use std::path::{Path, PathBuf, Component};
99
use std::process::Command;
1010

11+
use build_helper::t;
12+
1113
use crate::dist::{self, pkgname, sanitize_sh, tmpdir};
1214

1315
use crate::builder::{Builder, RunConfig, ShouldRun, Step};

src/bootstrap/lib.rs

+3-12
Original file line numberDiff line numberDiff line change
@@ -108,17 +108,6 @@
108108
#![feature(core_intrinsics)]
109109
#![feature(drain_filter)]
110110

111-
#[macro_use]
112-
extern crate build_helper;
113-
#[macro_use]
114-
extern crate serde_derive;
115-
#[macro_use]
116-
extern crate lazy_static;
117-
118-
#[cfg(test)]
119-
#[macro_use]
120-
extern crate pretty_assertions;
121-
122111
use std::cell::{RefCell, Cell};
123112
use std::collections::{HashSet, HashMap};
124113
use std::env;
@@ -134,7 +123,9 @@ use std::os::unix::fs::symlink as symlink_file;
134123
#[cfg(windows)]
135124
use std::os::windows::fs::symlink_file;
136125

137-
use build_helper::{run_silent, run_suppressed, try_run_silent, try_run_suppressed, output, mtime};
126+
use build_helper::{
127+
mtime, output, run_silent, run_suppressed, t, try_run_silent, try_run_suppressed,
128+
};
138129
use filetime::FileTime;
139130

140131
use crate::util::{exe, libdir, OutputFolder, CiEnv};

src/bootstrap/metadata.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::path::PathBuf;
44
use std::collections::HashSet;
55

66
use build_helper::output;
7+
use serde::Deserialize;
78
use serde_json;
89

910
use crate::{Build, Crate};

src/bootstrap/native.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::fs::{self, File};
1414
use std::path::{Path, PathBuf};
1515
use std::process::Command;
1616

17-
use build_helper::output;
17+
use build_helper::{output, t};
1818
use cmake;
1919
use cc;
2020

src/bootstrap/sanity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::fs;
1515
use std::path::PathBuf;
1616
use std::process::Command;
1717

18-
use build_helper::output;
18+
use build_helper::{output, t};
1919

2020
use crate::Build;
2121

src/bootstrap/test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use std::iter;
1111
use std::path::{Path, PathBuf};
1212
use std::process::Command;
1313

14-
use build_helper::{self, output};
14+
use build_helper::{self, output, t};
1515

1616
use crate::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
1717
use crate::cache::{Interned, INTERNER};

src/bootstrap/tool.rs

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use std::path::PathBuf;
44
use std::process::{Command, exit};
55
use std::collections::HashSet;
66

7+
use build_helper::t;
8+
79
use crate::Mode;
810
use crate::Compiler;
911
use crate::builder::{Step, RunConfig, ShouldRun, Builder};

src/bootstrap/toolstate.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use serde::{Deserialize, Serialize};
2+
13
#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
24
#[serde(rename_all = "kebab-case")]
35
/// Whether a tool can be compiled, tested or neither

src/bootstrap/util.rs

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ use std::path::{Path, PathBuf};
1111
use std::process::Command;
1212
use std::time::{SystemTime, Instant};
1313

14+
use build_helper::t;
15+
1416
use crate::config::Config;
1517
use crate::builder::Builder;
1618

src/tools/build-manifest/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ edition = "2018"
77
[dependencies]
88
toml = "0.4"
99
serde = { version = "1.0", features = ["derive"] }
10-
serde_derive = "1.0"

src/tools/compiletest/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ filetime = "0.2"
1111
getopts = "0.2"
1212
log = "0.4"
1313
regex = "1.0"
14-
serde = "1.0"
14+
serde = { version = "1.0", features = ["derive"] }
1515
serde_json = "1.0"
16-
serde_derive = "1.0"
1716
rustfix = "0.4.1"
1817
lazy_static = "1.0"
1918
walkdir = "2"

src/tools/compiletest/src/errors.rs

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ use std::io::BufReader;
77
use std::path::Path;
88
use std::str::FromStr;
99

10+
use log::*;
11+
1012
#[derive(Clone, Debug, PartialEq)]
1113
pub enum ErrorKind {
1214
Help,

src/tools/compiletest/src/header.rs

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use std::io::prelude::*;
44
use std::io::BufReader;
55
use std::path::{Path, PathBuf};
66

7+
use log::*;
8+
79
use crate::common::{self, CompareMode, Config, Mode};
810
use crate::util;
911

src/tools/compiletest/src/json.rs

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
44
use crate::errors::{Error, ErrorKind};
55
use crate::runtest::ProcRes;
6+
use serde::Deserialize;
67
use serde_json;
78
use std::path::{Path, PathBuf};
89
use std::str::FromStr;

src/tools/compiletest/src/main.rs

+1-8
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,6 @@
33
#![feature(vec_remove_item)]
44
#![deny(warnings, rust_2018_idioms)]
55

6-
#[cfg(unix)]
7-
extern crate libc;
8-
#[macro_use]
9-
extern crate log;
10-
#[macro_use]
11-
extern crate lazy_static;
12-
#[macro_use]
13-
extern crate serde_derive;
146
extern crate test;
157

168
use crate::common::CompareMode;
@@ -30,6 +22,7 @@ use crate::util::logv;
3022
use walkdir::WalkDir;
3123
use env_logger;
3224
use getopts;
25+
use log::*;
3326

3427
use self::header::{EarlyProps, Ignore};
3528

src/tools/compiletest/src/runtest.rs

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ use std::path::{Path, PathBuf};
2929
use std::process::{Child, Command, ExitStatus, Output, Stdio};
3030
use std::str;
3131

32+
use lazy_static::lazy_static;
33+
use log::*;
34+
3235
use crate::extract_gdb_version;
3336
use crate::is_android_gdb_target;
3437

src/tools/compiletest/src/util.rs

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ use std::env;
33
use std::path::PathBuf;
44
use crate::common::Config;
55

6+
use log::*;
7+
68
/// Conversion table from triple OS name to Rust SYSNAME
79
const OS_TABLE: &'static [(&'static str, &'static str)] = &[
810
("android", "android"),

src/tools/tidy/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ edition = "2018"
66

77
[dependencies]
88
regex = "1"
9-
serde = "1.0.8"
10-
serde_derive = "1.0.8"
9+
serde = { version = "1.0.8", features = ["derive"] }
1110
serde_json = "1.0.2"

src/tools/tidy/src/deps.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::fs;
55
use std::path::Path;
66
use std::process::Command;
77

8-
use serde_derive::Deserialize;
8+
use serde::Deserialize;
99
use serde_json;
1010

1111
const LICENSES: &[&str] = &[

0 commit comments

Comments
 (0)