Skip to content

Commit e74d88d

Browse files
committed
Don't run cargo-clippy if not available + Refactor + Remove Clippy from Profile::all
1 parent 4675a7b commit e74d88d

File tree

3 files changed

+17
-14
lines changed

3 files changed

+17
-14
lines changed

collector/src/bin/collector.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,9 +1197,18 @@ fn bench_published_artifact(
11971197
let artifact_id = ArtifactId::Tag(toolchain.id.clone());
11981198

11991199
let profiles = if collector::version_supports_doc(&toolchain.id) {
1200-
Profile::all()
1200+
vec![
1201+
Profile::Check,
1202+
Profile::Debug,
1203+
Profile::Doc,
1204+
Profile::Opt
1205+
]
12011206
} else {
1202-
Profile::all_non_doc()
1207+
vec![
1208+
Profile::Check,
1209+
Profile::Debug,
1210+
Profile::Opt,
1211+
]
12031212
};
12041213
let scenarios = if collector::version_supports_incremental(&toolchain.id) {
12051214
Scenario::all()

collector/src/compile/benchmark/profile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub enum Profile {
1717

1818
impl Profile {
1919
pub fn all() -> Vec<Self> {
20-
vec![Profile::Check, Profile::Debug, Profile::Doc, Profile::Opt, Profile::Clippy]
20+
vec![Profile::Check, Profile::Debug, Profile::Doc, Profile::Opt]
2121
}
2222

2323
// This also leaves Clippy out

collector/src/toolchain.rs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ impl SysrootDownload {
123123
let components = ToolchainComponents::from_binaries_and_libdir(
124124
sysroot_bin("rustc")?,
125125
Some(sysroot_bin("rustdoc")?),
126-
Some(sysroot_bin("clippy")?),
126+
match sysroot_bin("cargo-clippy") {
127+
Err(_) => None,
128+
Ok(path) => Some(path)
129+
},
127130
sysroot_bin("cargo")?,
128131
&self.directory.join(&self.rust_sha).join("lib"),
129132
)?;
@@ -292,7 +295,7 @@ impl ToolchainComponents {
292295
}
293296
}
294297

295-
#[derive(Clone, Copy)]
298+
#[derive(Clone, Copy, Default)]
296299
pub struct ToolchainConfig<'a> {
297300
rustdoc: Option<&'a Path>,
298301
clippy: Option<&'a Path>,
@@ -301,15 +304,6 @@ pub struct ToolchainConfig<'a> {
301304
}
302305

303306
impl<'a> ToolchainConfig<'a> {
304-
pub fn default() -> Self {
305-
Self {
306-
rustdoc: None,
307-
clippy: None,
308-
cargo: None,
309-
id: None
310-
}
311-
}
312-
313307
pub fn rustdoc(&mut self, rustdoc: Option<&'a Path>) -> &mut Self {
314308
self.rustdoc = rustdoc;
315309
self

0 commit comments

Comments
 (0)