diff options
| author | Mark Simulacrum <mark.simulacrum@gmail.com> | 2017-06-27 09:05:47 -0600 |
|---|---|---|
| committer | Mark Simulacrum <mark.simulacrum@gmail.com> | 2017-07-04 07:31:55 -0600 |
| commit | 802b6db0041115d261f3d0ea1855f35658141c0b (patch) | |
| tree | 90b1e77a64f96c6ba4aff5310b16a497640a3353 /src/bootstrap | |
| parent | c6ece966ac6745f71f21f98454193e41ad85fe42 (diff) | |
| download | rust-802b6db0041115d261f3d0ea1855f35658141c0b.tar.gz rust-802b6db0041115d261f3d0ea1855f35658141c0b.zip | |
Cleanup dist
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/dist.rs | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs index 753bd1df0d8..cfcba07228b 100644 --- a/src/bootstrap/dist.rs +++ b/src/bootstrap/dist.rs @@ -97,7 +97,7 @@ pub fn docs(build: &Build, stage: u32, host: &str) { } fn find_files(files: &[&str], path: &[PathBuf]) -> Vec<PathBuf> { - let mut found = Vec::new(); + let mut found = Vec::with_capacity(files.len()); for file in files { let file_path = @@ -119,17 +119,9 @@ fn make_win_dist(rust_root: &Path, plat_root: &Path, target_triple: &str, build: //Ask gcc where it keeps its stuff let mut cmd = Command::new(build.cc(target_triple)); cmd.arg("-print-search-dirs"); - build.run_quiet(&mut cmd); - let gcc_out = - String::from_utf8( - cmd - .output() - .expect("failed to execute gcc") - .stdout).expect("gcc.exe output was not utf8"); - - let mut bin_path: Vec<_> = - env::split_paths(&env::var_os("PATH").unwrap_or_default()) - .collect(); + let gcc_out = output(&mut cmd); + + let mut bin_path: Vec<_> = env::split_paths(&env::var_os("PATH").unwrap_or_default()).collect(); let mut lib_path = Vec::new(); for line in gcc_out.lines() { @@ -140,7 +132,7 @@ fn make_win_dist(rust_root: &Path, plat_root: &Path, target_triple: &str, build: line[(idx + 1)..] .trim_left_matches(trim_chars) .split(';') - .map(|s| PathBuf::from(s)); + .map(PathBuf::from); if key == "programs" { bin_path.extend(value); @@ -149,7 +141,7 @@ fn make_win_dist(rust_root: &Path, plat_root: &Path, target_triple: &str, build: } } - let target_tools = vec!["gcc.exe", "ld.exe", "ar.exe", "dlltool.exe", "libwinpthread-1.dll"]; + let target_tools = ["gcc.exe", "ld.exe", "ar.exe", "dlltool.exe", "libwinpthread-1.dll"]; let mut rustc_dlls = vec!["libstdc++-6.dll", "libwinpthread-1.dll"]; if target_triple.starts_with("i686-") { rustc_dlls.push("libgcc_s_dw2-1.dll"); @@ -157,7 +149,7 @@ fn make_win_dist(rust_root: &Path, plat_root: &Path, target_triple: &str, build: rustc_dlls.push("libgcc_s_seh-1.dll"); } - let target_libs = vec