summaryrefslogtreecommitdiffstats
path: root/src/bootstrap/bin/rustc.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:59:35 +0000
commitd1b2d29528b7794b41e66fc2136e395a02f8529b (patch)
treea4a17504b260206dec3cf55b2dca82929a348ac2 /src/bootstrap/bin/rustc.rs
parentReleasing progress-linux version 1.72.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.tar.xz
rustc-d1b2d29528b7794b41e66fc2136e395a02f8529b.zip
Merging upstream version 1.73.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/bootstrap/bin/rustc.rs')
-rw-r--r--src/bootstrap/bin/rustc.rs23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index e87125a49..10718aeb8 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -120,7 +120,7 @@ fn main() {
// Override linker if necessary.
if let Ok(host_linker) = env::var("RUSTC_HOST_LINKER") {
- cmd.arg(format!("-Clinker={}", host_linker));
+ cmd.arg(format!("-Clinker={host_linker}"));
}
if env::var_os("RUSTC_HOST_FUSE_LD_LLD").is_some() {
cmd.arg("-Clink-args=-fuse-ld=lld");
@@ -206,11 +206,11 @@ fn main() {
env::vars().filter(|(k, _)| k.starts_with("RUST") || k.starts_with("CARGO"));
let prefix = if is_test { "[RUSTC-SHIM] rustc --test" } else { "[RUSTC-SHIM] rustc" };
let prefix = match crate_name {
- Some(crate_name) => format!("{} {}", prefix, crate_name),
+ Some(crate_name) => format!("{prefix} {crate_name}"),
None => prefix.to_string(),
};
for (i, (k, v)) in rust_env_vars.enumerate() {
- eprintln!("{} env[{}]: {:?}={:?}", prefix, i, k, v);
+ eprintln!("{prefix} env[{i}]: {k:?}={v:?}");
}
eprintln!("{} working directory: {}", prefix, env::current_dir().unwrap().display());
eprintln!(
@@ -220,13 +220,13 @@ fn main() {
env::join_paths(&dylib_path).unwrap(),
cmd,
);
- eprintln!("{} sysroot: {:?}", prefix, sysroot);
- eprintln!("{} libdir: {:?}", prefix, libdir);
+ eprintln!("{prefix} sysroot: {sysroot:?}");
+ eprintln!("{prefix} libdir: {libdir:?}");
}
let start = Instant::now();
let (child, status) = {
- let errmsg = format!("\nFailed to run:\n{:?}\n-------------", cmd);
+ let errmsg = format!("\nFailed to run:\n{cmd:?}\n-------------");
let mut child = cmd.spawn().expect(&errmsg);
let status = child.wait().expect(&errmsg);
(child, status)
@@ -259,7 +259,7 @@ fn main() {
// should run on success, after this block.
}
if verbose > 0 {
- println!("\nDid not run successfully: {}\n{:?}\n-------------", status, cmd);
+ println!("\nDid not run successfully: {status}\n{cmd:?}\n-------------");
}
if let Some(mut on_fail) = on_fail {
@@ -271,7 +271,7 @@ fn main() {
match status.code() {
Some(i) => std::process::exit(i),
None => {
- eprintln!("rustc exited with {}", status);
+ eprintln!("rustc exited with {status}");
std::process::exit(0xfe);
}
}
@@ -396,21 +396,20 @@ fn format_rusage_data(_child: Child) -> Option<String> {
let minflt = rusage.ru_minflt;
let majflt = rusage.ru_majflt;
if minflt != 0 || majflt != 0 {
- init_str.push_str(&format!(" page reclaims: {} page faults: {}", minflt, majflt));
+ init_str.push_str(&format!(" page reclaims: {minflt} page faults: {majflt}"));
}
let inblock = rusage.ru_inblock;
let oublock = rusage.ru_oublock;
if inblock != 0 || oublock != 0 {
- init_str.push_str(&format!(" fs block inputs: {} fs block outputs: {}", inblock, oublock));
+ init_str.push_str(&format!(" fs block inputs: {inblock} fs block outputs: {oublock}"));
}
let nvcsw = rusage.ru_nvcsw;
let nivcsw = rusage.ru_nivcsw;
if nvcsw != 0 || nivcsw != 0 {
init_str.push_str(&format!(
- " voluntary ctxt switches: {} involuntary ctxt switches: {}",
- nvcsw, nivcsw
+ " voluntary ctxt switches: {nvcsw} involuntary ctxt switches: {nivcsw}"
));
}