Skip to content

Commit 1e0008d

Browse files
authored
Merge branch 'main' into switch-once-cell-crate-to-standard-library
2 parents 8a3b95c + 77ce75c commit 1e0008d

File tree

25 files changed

+93
-95
lines changed

25 files changed

+93
-95
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ And you can build code as usual without any additional flags in the command line
188188
Build Requirements
189189
------------------
190190

191-
sccache is a [Rust](https://www.rust-lang.org/) program. Building it requires `cargo` (and thus`rustc`). sccache currently requires **Rust 1.75.0**. We recommend you install Rust via [Rustup](https://rustup.rs/).
191+
sccache is a [Rust](https://www.rust-lang.org/) program. Building it requires `cargo` (and thus`rustc`). sccache currently requires **Rust 1.85.0**. We recommend you install Rust via [Rustup](https://rustup.rs/).
192192

193193
Build
194194
-----

src/cache/cache.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,10 +507,10 @@ impl Storage for opendal::Operator {
507507
// can do, so we will print our the error here to make users know
508508
// about it.
509509
Err(err) if err.kind() == ErrorKind::RateLimited => {
510-
eprintln!("cache storage read check: {err:?}, but we decide to keep running")
510+
eprintln!("cache storage read check: {err:?}, but we decide to keep running");
511511
}
512512
Err(err) => bail!("cache storage failed to read: {:?}", err),
513-
};
513+
}
514514

515515
let can_write = match self.write(path, "Hello, World!").await {
516516
Ok(_) => true,

src/cmdline.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ use which::which_in;
2222

2323
const ENV_VAR_INTERNAL_START_SERVER: &str = "SCCACHE_START_SERVER";
2424

25-
#[derive(Debug, Clone, ValueEnum)]
25+
#[derive(Debug, Clone, ValueEnum, Default)]
2626
pub enum StatsFormat {
27+
#[default]
2728
Text,
2829
Json,
2930
}
@@ -49,12 +50,6 @@ impl FromStr for StatsFormat {
4950
}
5051
}
5152

52-
impl Default for StatsFormat {
53-
fn default() -> Self {
54-
Self::Text
55-
}
56-
}
57-
5853
/// A specific command to run.
5954
pub enum Command {
6055
/// Show cache statistics and exit.

src/commands.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ fn connect_or_start_server(
322322
}
323323
}
324324
ServerStartup::AddrInUse => {
325-
debug!("AddrInUse: possible parallel server bootstraps, retrying..")
325+
debug!("AddrInUse: possible parallel server bootstraps, retrying..");
326326
}
327327
ServerStartup::TimedOut => bail!(
328328
"Timed out waiting for server startup. Maybe the remote service is unreachable?\nRun with SCCACHE_LOG=debug SCCACHE_NO_DAEMON=1 to get more information"
@@ -558,7 +558,7 @@ where
558558
CompileResponse::UnhandledCompile => {
559559
debug!("Server sent UnhandledCompile");
560560
}
561-
};
561+
}
562562

563563
let mut cmd = creator.new_command_sync(exe);
564564
cmd.args(&cmdline).current_dir(cwd);
@@ -703,7 +703,7 @@ pub fn run_command(cmd: Command) -> Result<i32> {
703703

704704
match &config.dist.auth {
705705
config::DistAuth::Token { .. } => {
706-
info!("No authentication needed for type 'token'")
706+
info!("No authentication needed for type 'token'");
707707
}
708708
config::DistAuth::Oauth2CodeGrantPKCE {
709709
client_id,
@@ -725,7 +725,7 @@ pub fn run_command(cmd: Command) -> Result<i32> {
725725
c.dist.auth_tokens.insert(auth_url.to_owned(), token);
726726
})
727727
.context("Unable to save auth token")?;
728-
println!("Saved token")
728+
println!("Saved token");
729729
}
730730
config::DistAuth::Oauth2Implicit {
731731
client_id,
@@ -743,9 +743,9 @@ pub fn run_command(cmd: Command) -> Result<i32> {
743743
c.dist.auth_tokens.insert(auth_url.to_owned(), token);
744744
})
745745
.context("Unable to save auth token")?;
746-
println!("Saved token")
746+
println!("Saved token");
747747
}
748-
};
748+
}
749749
}
750750
#[cfg(not(feature = "dist-client"))]
751751
Command::DistAuth => bail!(
@@ -777,7 +777,7 @@ pub fn run_command(cmd: Command) -> Result<i32> {
777777
.await
778778
.map(|compiler| compiler.0.get_toolchain_packager())
779779
.and_then(|packager| packager.write_pkg(out_file))
780-
})?
780+
})?;
781781
}
782782
#[cfg(not(feature = "dist-client"))]
783783
Command::PackageToolchain(_executable, _out) => bail!(

src/compiler/c.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ impl<T: CommandCreatorSync, I: CCompilerImpl> Compiler<T> for CCompiler<I> {
319319
// Handle SCCACHE_EXTRAFILES
320320
for (k, v) in env_vars.iter() {
321321
if k.as_os_str() == OsStr::new("SCCACHE_EXTRAFILES") {
322-
args.extra_hash_files.extend(std::env::split_paths(&v))
322+
args.extra_hash_files.extend(std::env::split_paths(&v));
323323
}
324324
}
325325

@@ -336,7 +336,7 @@ impl<T: CommandCreatorSync, I: CCompilerImpl> Compiler<T> for CCompiler<I> {
336336
// too much to handle on our side so we just hash every bitcode library we find.
337337
if args.language == Language::Hip {
338338
args.extra_hash_files
339-
.extend(Self::search_hip_device_libs(&args, env_vars))
339+
.extend(Self::search_hip_device_libs(&args, env_vars));
340340
}
341341

342342
CompilerArguments::Ok(Box::new(CCompilerHasher {
@@ -757,7 +757,7 @@ fn process_preprocessed_file(
757757
hash_start = h;
758758
continue;
759759
}
760-
};
760+
}
761761
} else if slice
762762
.strip_prefix(INCBIN_DIRECTIVE)
763763
.filter(|slice| {
@@ -923,7 +923,7 @@ fn process_preprocessor_line(
923923
fs_impl,
924924
)? {
925925
return Ok(ControlFlow::Break((start, hash_start, false)));
926-
};
926+
}
927927
// Everything of interest between hash_start and start has been hashed now.
928928
hash_start = start;
929929
Ok(ControlFlow::Continue((start, hash_start)))

src/compiler/cicc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ where
196196
args.extend(arg.iter_os_strings());
197197
}
198198
_ => continue,
199-
};
199+
}
200200
}
201201

202202
if let Some(module_id_path) = module_id_file_name {

src/compiler/clang.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl CCompilerImpl for Clang {
128128

129129
// Clang 14 and later support -fminimize-whitespace, which normalizes away non-semantic whitespace which in turn increases cache hit rate.
130130
if self.is_minversion(14) {
131-
ignorable_whitespace_flags.push("-fminimize-whitespace".to_string())
131+
ignorable_whitespace_flags.push("-fminimize-whitespace".to_string());
132132
}
133133

134134
gcc::preprocess(

src/compiler/gcc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ where
421421
)
422422
}
423423
_ => {}
424-
};
424+
}
425425
seen_arch = Some(arch.clone());
426426
}
427427
Some(XClang(s)) => xclangs.push(s.clone()),
@@ -566,7 +566,7 @@ where
566566
};
567567
for arg in arg.normalize(norm).iter_os_strings() {
568568
args.push("-Xclang".into());
569-
args.push(arg)
569+
args.push(arg);
570570
}
571571
}
572572

@@ -868,7 +868,7 @@ where
868868
let language = language_to_arg(parsed_args.language);
869869
let mut arguments: Vec<OsString> = vec![];
870870
if let Some(lang) = &language {
871-
arguments.extend(vec!["-x".into(), lang.into()])
871+
arguments.extend(vec!["-x".into(), lang.into()]);
872872
}
873873
arguments.extend(vec![
874874
parsed_args.compilation_flag.clone(),
@@ -927,7 +927,7 @@ where
927927
let mut arguments: Vec<String> = vec![];
928928
// Language needs to be before input
929929
if let Some(lang) = &language {
930-
arguments.extend(vec!["-x".into(), lang.into()])
930+
arguments.extend(vec!["-x".into(), lang.into()]);
931931
}
932932
arguments.extend(vec![
933933
parsed_args.compilation_flag.clone().into_string().ok()?,

src/compiler/msvc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ pub fn parse_arguments(
610610
common_args.extend(
611611
arg.normalize(NormalizedDisposition::Concatenated)
612612
.iter_os_strings(),
613-
)
613+
);
614614
}
615615
Some(ExternalIncludePath(_)) => common_args.extend(
616616
arg.normalize(NormalizedDisposition::Separated)

src/compiler/nvcc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ pub fn generate_compile_commands(
328328
keep = true;
329329
unhashed_args.splice(idx..(idx + 1), []);
330330
if keep_dir.is_none() {
331-
keep_dir = Some(cwd.to_path_buf())
331+
keep_dir = Some(cwd.to_path_buf());
332332
}
333333
continue;
334334
}
@@ -391,7 +391,7 @@ pub fn generate_compile_commands(
391391
let mut arguments = vec![];
392392

393393
if let Some(lang) = gcc::language_to_gcc_arg(parsed_args.language) {
394-
arguments.extend(vec!["-x".into(), lang.into()])
394+
arguments.extend(vec!["-x".into(), lang.into()]);
395395
}
396396

397397
let output = &parsed_args

0 commit comments

Comments
 (0)