Skip to content

Commit

Permalink
remove unneeded extern crates from build tools
Browse files Browse the repository at this point in the history
  • Loading branch information
euclio committed May 9, 2019
1 parent e630580 commit b2f71fb
Show file tree
Hide file tree
Showing 28 changed files with 81 additions and 75 deletions.
76 changes: 36 additions & 40 deletions Cargo.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/bootstrap/Cargo.toml
Expand Up @@ -42,11 +42,10 @@ num_cpus = "1.0"
getopts = "0.2.19"
cc = "1.0.35"
libc = "0.2"
serde = "1.0.8"
serde_derive = "1.0.8"
serde = { version = "1.0.8", features = ["derive"] }
serde_json = "1.0.2"
toml = "0.4"
lazy_static = "0.2"
lazy_static = "1.3.0"
time = "0.1"
petgraph = "0.4.13"

Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/builder.rs
Expand Up @@ -11,6 +11,8 @@ use std::path::{Path, PathBuf};
use std::process::Command;
use std::time::{Duration, Instant};

use build_helper::t;

use crate::cache::{Cache, Interned, INTERNER};
use crate::check;
use crate::compile;
Expand Down Expand Up @@ -1308,6 +1310,8 @@ mod __test {
use crate::config::Config;
use std::thread;

use pretty_assertions::assert_eq;

fn configure(host: &[&str], target: &[&str]) -> Config {
let mut config = Config::default_opts();
// don't save toolstates
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/cache.rs
Expand Up @@ -13,6 +13,8 @@ use std::path::{Path, PathBuf};
use std::sync::Mutex;
use std::cmp::{PartialOrd, Ord, Ordering};

use lazy_static::lazy_static;

use crate::builder::Step;

pub struct Interned<T>(usize, PhantomData<*const T>);
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/clean.rs
Expand Up @@ -9,6 +9,8 @@ use std::fs;
use std::io::{self, ErrorKind};
use std::path::Path;

use build_helper::t;

use crate::Build;

pub fn clean(build: &Build, all: bool) {
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/compile.rs
Expand Up @@ -15,8 +15,9 @@ use std::path::{Path, PathBuf};
use std::process::{Command, Stdio, exit};
use std::str;

use build_helper::{output, mtime, up_to_date};
use build_helper::{output, mtime, t, up_to_date};
use filetime::FileTime;
use serde::Deserialize;
use serde_json;

use crate::dist;
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/config.rs
Expand Up @@ -10,8 +10,10 @@ use std::path::{Path, PathBuf};
use std::process;
use std::cmp;

use build_helper::t;
use num_cpus;
use toml;
use serde::Deserialize;
use crate::cache::{INTERNER, Interned};
use crate::flags::Flags;
pub use crate::flags::Subcommand;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/dist.rs
Expand Up @@ -14,7 +14,7 @@ use std::io::Write;
use std::path::{PathBuf, Path};
use std::process::{Command, Stdio};

use build_helper::output;
use build_helper::{output, t};

use crate::{Compiler, Mode, LLVM_TOOLS};
use crate::channel;
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/doc.rs
Expand Up @@ -13,7 +13,7 @@ use std::io;
use std::path::{PathBuf, Path};

use crate::Mode;
use build_helper::up_to_date;
use build_helper::{t, up_to_date};

use crate::util::symlink_dir;
use crate::builder::{Builder, Compiler, RunConfig, ShouldRun, Step};
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/install.rs
Expand Up @@ -8,6 +8,8 @@ use std::fs;
use std::path::{Path, PathBuf, Component};
use std::process::Command;

use build_helper::t;

use crate::dist::{self, pkgname, sanitize_sh, tmpdir};

use crate::builder::{Builder, RunConfig, ShouldRun, Step};
Expand Down
15 changes: 3 additions & 12 deletions src/bootstrap/lib.rs
Expand Up @@ -108,17 +108,6 @@
#![feature(core_intrinsics)]
#![feature(drain_filter)]

#[macro_use]
extern crate build_helper;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate lazy_static;

#[cfg(test)]
#[macro_use]
extern crate pretty_assertions;

use std::cell::{RefCell, Cell};
use std::collections::{HashSet, HashMap};
use std::env;
Expand All @@ -134,7 +123,9 @@ use std::os::unix::fs::symlink as symlink_file;
#[cfg(windows)]
use std::os::windows::fs::symlink_file;

use build_helper::{run_silent, run_suppressed, try_run_silent, try_run_suppressed, output, mtime};
use build_helper::{
mtime, output, run_silent, run_suppressed, t, try_run_silent, try_run_suppressed,
};
use filetime::FileTime;

use crate::util::{exe, libdir, OutputFolder, CiEnv};
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/metadata.rs
Expand Up @@ -4,6 +4,7 @@ use std::path::PathBuf;
use std::collections::HashSet;

use build_helper::output;
use serde::Deserialize;
use serde_json;

use crate::{Build, Crate};
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/native.rs
Expand Up @@ -14,7 +14,7 @@ use std::fs::{self, File};
use std::path::{Path, PathBuf};
use std::process::Command;

use build_helper::output;
use build_helper::{output, t};
use cmake;
use cc;

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/sanity.rs
Expand Up @@ -15,7 +15,7 @@ use std::fs;
use std::path::PathBuf;
use std::process::Command;

use build_helper::output;
use build_helper::{output, t};

use crate::Build;

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/test.rs
Expand Up @@ -11,7 +11,7 @@ use std::iter;
use std::path::{Path, PathBuf};
use std::process::Command;

use build_helper::{self, output};
use build_helper::{self, output, t};

use crate::builder::{Builder, Compiler, Kind, RunConfig, ShouldRun, Step};
use crate::cache::{Interned, INTERNER};
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/tool.rs
Expand Up @@ -4,6 +4,8 @@ use std::path::PathBuf;
use std::process::{Command, exit};
use std::collections::HashSet;

use build_helper::t;

use crate::Mode;
use crate::Compiler;
use crate::builder::{Step, RunConfig, ShouldRun, Builder};
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/toolstate.rs
@@ -1,3 +1,5 @@
use serde::{Deserialize, Serialize};

#[derive(Copy, Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
/// Whether a tool can be compiled, tested or neither
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/util.rs
Expand Up @@ -11,6 +11,8 @@ use std::path::{Path, PathBuf};
use std::process::Command;
use std::time::{SystemTime, Instant};

use build_helper::t;

use crate::config::Config;
use crate::builder::Builder;

Expand Down
1 change: 0 additions & 1 deletion src/tools/build-manifest/Cargo.toml
Expand Up @@ -7,4 +7,3 @@ edition = "2018"
[dependencies]
toml = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_derive = "1.0"
3 changes: 1 addition & 2 deletions src/tools/compiletest/Cargo.toml
Expand Up @@ -11,9 +11,8 @@ filetime = "0.2"
getopts = "0.2"
log = "0.4"
regex = "1.0"
serde = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
serde_derive = "1.0"
rustfix = "0.4.1"
lazy_static = "1.0"
walkdir = "2"
Expand Down
2 changes: 2 additions & 0 deletions src/tools/compiletest/src/errors.rs
Expand Up @@ -7,6 +7,8 @@ use std::io::BufReader;
use std::path::Path;
use std::str::FromStr;

use log::*;

#[derive(Clone, Debug, PartialEq)]
pub enum ErrorKind {
Help,
Expand Down
2 changes: 2 additions & 0 deletions src/tools/compiletest/src/header.rs
Expand Up @@ -4,6 +4,8 @@ use std::io::prelude::*;
use std::io::BufReader;
use std::path::{Path, PathBuf};

use log::*;

use crate::common::{self, CompareMode, Config, Mode};
use crate::util;

Expand Down
1 change: 1 addition & 0 deletions src/tools/compiletest/src/json.rs
Expand Up @@ -3,6 +3,7 @@

use crate::errors::{Error, ErrorKind};
use crate::runtest::ProcRes;
use serde::Deserialize;
use serde_json;
use std::path::{Path, PathBuf};
use std::str::FromStr;
Expand Down
9 changes: 1 addition & 8 deletions src/tools/compiletest/src/main.rs
Expand Up @@ -3,14 +3,6 @@
#![feature(vec_remove_item)]
#![deny(warnings, rust_2018_idioms)]

#[cfg(unix)]
extern crate libc;
#[macro_use]
extern crate log;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate serde_derive;
extern crate test;

use crate::common::CompareMode;
Expand All @@ -30,6 +22,7 @@ use crate::util::logv;
use walkdir::WalkDir;
use env_logger;
use getopts;
use log::*;

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

Expand Down
3 changes: 3 additions & 0 deletions src/tools/compiletest/src/runtest.rs
Expand Up @@ -29,6 +29,9 @@ use std::path::{Path, PathBuf};
use std::process::{Child, Command, ExitStatus, Output, Stdio};
use std::str;

use lazy_static::lazy_static;
use log::*;

use crate::extract_gdb_version;
use crate::is_android_gdb_target;

Expand Down
2 changes: 2 additions & 0 deletions src/tools/compiletest/src/util.rs
Expand Up @@ -3,6 +3,8 @@ use std::env;
use std::path::PathBuf;
use crate::common::Config;

use log::*;

/// Conversion table from triple OS name to Rust SYSNAME
const OS_TABLE: &'static [(&'static str, &'static str)] = &[
("android", "android"),
Expand Down
3 changes: 1 addition & 2 deletions src/tools/tidy/Cargo.toml
Expand Up @@ -6,6 +6,5 @@ edition = "2018"

[dependencies]
regex = "1"
serde = "1.0.8"
serde_derive = "1.0.8"
serde = { version = "1.0.8", features = ["derive"] }
serde_json = "1.0.2"
2 changes: 1 addition & 1 deletion src/tools/tidy/src/deps.rs
Expand Up @@ -5,7 +5,7 @@ use std::fs;
use std::path::Path;
use std::process::Command;

use serde_derive::Deserialize;
use serde::Deserialize;
use serde_json;

const LICENSES: &[&str] = &[
Expand Down

0 comments on commit b2f71fb

Please sign in to comment.