Skip to content

Commit 3589dea

Browse files
committed
Fix Clippy
1 parent ccbceba commit 3589dea

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use crate::utils::exec::command;
3030
use crate::utils::helpers::{
3131
exe, get_clang_cl_resource_dir, is_debug_info, is_dylib, symlink_dir, t, up_to_date,
3232
};
33-
use crate::{CLang, Compiler, DependencyType, GitRepo, LLVM_TOOLS, Mode, trace_cmd};
33+
use crate::{CLang, Compiler, DependencyType, GitRepo, LLVM_TOOLS, Mode};
3434

3535
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
3636
pub struct Std {
@@ -2235,7 +2235,8 @@ pub fn stream_cargo(
22352235
) -> bool {
22362236
let mut cmd = cargo.into_cmd();
22372237

2238-
let _run_span = trace_cmd!(cmd);
2238+
#[cfg(feature = "tracing")]
2239+
let _run_span = crate::trace_cmd!(cmd);
22392240

22402241
let cargo = cmd.as_command_mut();
22412242
// Instruct Cargo to give us json messages on stdout, critically leaving

src/bootstrap/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,7 @@ impl Build {
905905
return CommandOutput::default();
906906
}
907907

908+
#[cfg(feature = "tracing")]
908909
let _run_span = trace_cmd!(command);
909910

910911
let created_at = command.get_created_location();

src/bootstrap/src/utils/exec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ impl FormatShortCmd for Command {
347347
fn format_short_cmd(&self) -> String {
348348
let program = Path::new(self.get_program());
349349
let mut line = vec![program.file_name().unwrap().to_str().unwrap()];
350-
line.extend(self.get_args().into_iter().map(|arg| arg.to_str().unwrap()));
350+
line.extend(self.get_args().map(|arg| arg.to_str().unwrap()));
351351
line.join(" ")
352352
}
353353
}

src/bootstrap/src/utils/helpers.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ use std::{env, fs, io, str};
1313
use build_helper::util::fail;
1414
use object::read::archive::ArchiveFile;
1515

16+
use crate::LldMode;
1617
use crate::core::builder::Builder;
1718
use crate::core::config::{Config, TargetSelection};
1819
use crate::utils::exec::{BootstrapCommand, command};
1920
pub use crate::utils::shared_helpers::{dylib_path, dylib_path_var};
20-
use crate::{LldMode, trace_cmd};
2121

2222
#[cfg(test)]
2323
mod tests;
@@ -265,7 +265,8 @@ pub fn make(host: &str) -> PathBuf {
265265

266266
#[track_caller]
267267
pub fn output(cmd: &mut Command) -> String {
268-
let _run_span = trace_cmd!(cmd);
268+
#[cfg(feature = "tracing")]
269+
let _run_span = crate::trace_cmd!(cmd);
269270

270271
let output = match cmd.stderr(Stdio::inherit()).output() {
271272
Ok(status) => status,

src/bootstrap/src/utils/tracing.rs

-2
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ macro_rules! error {
5252
macro_rules! trace_cmd {
5353
($cmd:expr) => {
5454
{
55-
#[allow(unused)]
5655
use $crate::utils::exec::FormatShortCmd;
5756

58-
#[cfg(feature = "tracing")]
5957
::tracing::span!(
6058
target: "COMMAND",
6159
::tracing::Level::TRACE,

0 commit comments

Comments
 (0)