Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Clippy into the project #1724

Merged
merged 6 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions collector/src/bin/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1197,9 +1197,18 @@ fn bench_published_artifact(
let artifact_id = ArtifactId::Tag(toolchain.id.clone());

let profiles = if collector::version_supports_doc(&toolchain.id) {
Profile::all()
vec![
Profile::Check,
Profile::Debug,
Profile::Doc,
Profile::Opt
]
} else {
Profile::all_non_doc()
vec![
Profile::Check,
Profile::Debug,
Profile::Opt,
]
};
let scenarios = if collector::version_supports_incremental(&toolchain.id) {
Scenario::all()
Expand Down
2 changes: 1 addition & 1 deletion collector/src/compile/benchmark/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub enum Profile {

impl Profile {
pub fn all() -> Vec<Self> {
Kobzol marked this conversation as resolved.
Show resolved Hide resolved
vec![Profile::Check, Profile::Debug, Profile::Doc, Profile::Opt, Profile::Clippy]
vec![Profile::Check, Profile::Debug, Profile::Doc, Profile::Opt]
}

// This also leaves Clippy out
Expand Down
16 changes: 5 additions & 11 deletions collector/src/toolchain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ impl SysrootDownload {
let components = ToolchainComponents::from_binaries_and_libdir(
sysroot_bin("rustc")?,
Some(sysroot_bin("rustdoc")?),
Some(sysroot_bin("clippy")?),
match sysroot_bin("cargo-clippy") {
Kobzol marked this conversation as resolved.
Show resolved Hide resolved
Err(_) => None,
Ok(path) => Some(path)
},
sysroot_bin("cargo")?,
&self.directory.join(&self.rust_sha).join("lib"),
)?;
Expand Down Expand Up @@ -292,7 +295,7 @@ impl ToolchainComponents {
}
}

#[derive(Clone, Copy)]
#[derive(Clone, Copy, Default)]
pub struct ToolchainConfig<'a> {
rustdoc: Option<&'a Path>,
clippy: Option<&'a Path>,
Expand All @@ -301,15 +304,6 @@ pub struct ToolchainConfig<'a> {
}

impl<'a> ToolchainConfig<'a> {
pub fn default() -> Self {
Self {
rustdoc: None,
clippy: None,
cargo: None,
id: None
}
}

pub fn rustdoc(&mut self, rustdoc: Option<&'a Path>) -> &mut Self {
self.rustdoc = rustdoc;
self
Expand Down
Loading