Skip to content

Commit 4166849

Browse files
committed
bless tidy and remove unused function
Signed-off-by: onur-ozkan <[email protected]>
1 parent e1a9ba9 commit 4166849

File tree

11 files changed

+25
-38
lines changed

11 files changed

+25
-38
lines changed

src/bootstrap/src/core/build_steps/compile.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ use crate::core::builder::Cargo;
2727
use crate::core::builder::{Builder, Kind, PathSet, RunConfig, ShouldRun, Step, TaskPath};
2828
use crate::core::config::{DebuginfoLevel, LlvmLibunwind, RustcLto, TargetSelection};
2929
use crate::utils::cache::{Interned, INTERNER};
30-
use crate::utils::helpers::{exe, is_debug_info, get_clang_cl_resource_dir, is_dylib, output, symlink_dir, t, up_to_date};
30+
use crate::utils::helpers::{
31+
exe, get_clang_cl_resource_dir, is_debug_info, is_dylib, output, symlink_dir, t, up_to_date,
32+
};
3133
use crate::LLVM_TOOLS;
3234
use crate::{CLang, Compiler, DependencyType, GitRepo, Mode};
3335
use filetime::FileTime;

src/bootstrap/src/core/build_steps/dist.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ use crate::core::builder::{Builder, Kind, RunConfig, ShouldRun, Step};
2727
use crate::core::config::TargetSelection;
2828
use crate::utils::cache::{Interned, INTERNER};
2929
use crate::utils::channel;
30-
use crate::utils::tarball::{GeneratedTarball, OverlayKind, Tarball};
3130
use crate::utils::helpers::{exe, is_dylib, output, t, timeit};
31+
use crate::utils::tarball::{GeneratedTarball, OverlayKind, Tarball};
3232
use crate::{Compiler, DependencyType, Mode, LLVM_TOOLS};
3333

3434
pub fn pkgname(builder: &Builder<'_>, component: &str) -> String {

src/bootstrap/src/core/build_steps/install.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use std::process::Command;
1111
use crate::core::build_steps::dist;
1212
use crate::core::builder::{Builder, RunConfig, ShouldRun, Step};
1313
use crate::core::config::{Config, TargetSelection};
14-
use crate::utils::tarball::GeneratedTarball;
1514
use crate::utils::helpers::t;
15+
use crate::utils::tarball::GeneratedTarball;
1616
use crate::{Compiler, Kind};
1717

1818
#[cfg(target_os = "illumos")]

src/bootstrap/src/core/build_steps/llvm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::process::Command;
1919
use crate::core::builder::{Builder, RunConfig, ShouldRun, Step};
2020
use crate::core::config::{Config, TargetSelection};
2121
use crate::utils::channel;
22-
use crate::utils::helpers::{self, exe, output, t, up_to_date, get_clang_cl_resource_dir};
22+
use crate::utils::helpers::{self, exe, get_clang_cl_resource_dir, output, t, up_to_date};
2323
use crate::{CLang, GitRepo, Kind};
2424

2525
use build_helper::ci::CiEnv;

src/bootstrap/src/core/build_steps/test.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@ use crate::core::config::flags::Subcommand;
2727
use crate::core::config::TargetSelection;
2828
use crate::utils;
2929
use crate::utils::cache::{Interned, INTERNER};
30-
use crate::utils::render_tests::{try_run_tests, add_flags_and_try_run_tests};
31-
use crate::utils::helpers::{self, add_link_lib_path, dylib_path, dylib_path_var, output, t, up_to_date};
30+
use crate::utils::helpers::{
31+
self, add_link_lib_path, dylib_path, dylib_path_var, output, t, up_to_date,
32+
};
33+
use crate::utils::render_tests::{add_flags_and_try_run_tests, try_run_tests};
3234
use crate::{envify, CLang, DocTests, GitRepo, Mode};
3335

3436
const ADB_TEST_DIR: &str = "/data/local/tmp/work";
@@ -905,7 +907,8 @@ impl Step for RustdocJSStd {
905907
.arg("--test-folder")
906908
.arg(builder.src.join("tests/rustdoc-js-std"));
907909
for path in &builder.paths {
908-
if let Some(p) = helpers::is_valid_test_suite_arg(path, "tests/rustdoc-js-std", builder) {
910+
if let Some(p) = helpers::is_valid_test_suite_arg(path, "tests/rustdoc-js-std", builder)
911+
{
909912
if !p.ends_with(".js") {
910913
eprintln!("A non-js file was given: `{}`", path.display());
911914
panic!("Cannot run rustdoc-js-std tests");
@@ -2680,7 +2683,9 @@ impl Step for Distcheck {
26802683
.current_dir(&dir),
26812684
);
26822685
builder.run(
2683-
Command::new(helpers::make(&builder.config.build.triple)).arg("check").current_dir(&dir),
2686+
Command::new(helpers::make(&builder.config.build.triple))
2687+
.arg("check")
2688+
.current_dir(&dir),
26842689
);
26852690

26862691
// Now make sure that rust-src has all of libstd's dependencies

src/bootstrap/src/core/config/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ use std::str::FromStr;
2121
use crate::core::build_steps::compile::CODEGEN_BACKEND_PREFIX;
2222
use crate::core::config::flags::{Color, Flags, Warnings};
2323
use crate::utils::cache::{Interned, INTERNER};
24-
use crate::utils::channel::{self, GitInfo};
2524
use crate::utils::cc_detect::{ndk_compiler, Language};
25+
use crate::utils::channel::{self, GitInfo};
2626
use crate::utils::helpers::{exe, output, t};
2727
use build_helper::exit;
2828
use once_cell::sync::OnceCell;

src/bootstrap/src/core/download.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ use xz2::bufread::XzDecoder;
1414
use crate::core::build_steps::llvm::detect_llvm_sha;
1515
use crate::core::config::RustfmtMetadata;
1616
use crate::utils::helpers::{check_run, exe, program_out_of_date};
17-
use crate::{
18-
t,
19-
Config,
20-
};
17+
use crate::{t, Config};
2118

2219
static SHOULD_FIX_BINS_AND_DYLIBS: OnceCell<bool> = OnceCell::new();
2320

src/bootstrap/src/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ use std::str;
2929
use build_helper::ci::{gha, CiEnv};
3030
use build_helper::exit;
3131
use filetime::FileTime;
32-
use utils::channel::GitInfo;
3332
use once_cell::sync::OnceCell;
3433
use termcolor::{ColorChoice, StandardStream, WriteColor};
34+
use utils::channel::GitInfo;
3535

3636
use crate::core::builder;
3737
use crate::core::builder::Kind;
@@ -40,8 +40,8 @@ use crate::core::config::{DryRun, Target};
4040
use crate::core::config::{LlvmLibunwind, TargetSelection};
4141
use crate::utils::cache::{Interned, INTERNER};
4242
use crate::utils::helpers::{
43-
self,
44-
dir_is_empty, exe, libdir, mtime, output, run, run_suppressed, symlink_dir, try_run_suppressed,
43+
self, dir_is_empty, exe, libdir, mtime, output, run, run_suppressed, symlink_dir,
44+
try_run_suppressed,
4545
};
4646

4747
mod core;

src/bootstrap/src/utils/helpers.rs

-17
Original file line numberDiff line numberDiff line change
@@ -293,23 +293,6 @@ pub fn output(cmd: &mut Command) -> String {
293293
String::from_utf8(output.stdout).unwrap()
294294
}
295295

296-
pub fn output_result(cmd: &mut Command) -> Result<String, String> {
297-
let output = match cmd.stderr(Stdio::inherit()).output() {
298-
Ok(status) => status,
299-
Err(e) => return Err(format!("failed to run command: {cmd:?}: {e}")),
300-
};
301-
if !output.status.success() {
302-
return Err(format!(
303-
"command did not execute successfully: {:?}\n\
304-
expected success, got: {}\n{}",
305-
cmd,
306-
output.status,
307-
String::from_utf8(output.stderr).map_err(|err| format!("{err:?}"))?
308-
));
309-
}
310-
Ok(String::from_utf8(output.stdout).map_err(|err| format!("{err:?}"))?)
311-
}
312-
313296
/// Returns the last-modified time for `path`, or zero if it doesn't exist.
314297
pub fn mtime(path: &Path) -> SystemTime {
315298
fs::metadata(path).and_then(|f| f.modified()).unwrap_or(UNIX_EPOCH)

src/bootstrap/src/utils/mod.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
//! channels, job management, etc.
44
55
pub(crate) mod cache;
6-
pub(crate) mod channel;
7-
pub(crate) mod job;
8-
pub(crate) mod render_tests;
9-
pub(crate) mod tarball;
106
pub(crate) mod cc_detect;
7+
pub(crate) mod channel;
118
pub(crate) mod helpers;
9+
pub(crate) mod job;
1210
#[cfg(feature = "build-metrics")]
1311
pub(crate) mod metrics;
12+
pub(crate) mod render_tests;
13+
pub(crate) mod tarball;

src/bootstrap/src/utils/tarball.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use std::{
55

66
use crate::core::build_steps::dist::distdir;
77
use crate::core::builder::Builder;
8-
use crate::utils::helpers::t;
98
use crate::utils::channel;
9+
use crate::utils::helpers::t;
1010

1111
#[derive(Copy, Clone)]
1212
pub(crate) enum OverlayKind {

0 commit comments

Comments
 (0)