Skip to content

Switch cargo-clippy over to use rustup's clippy-driver #2901

@Manishearth

Description

@Manishearth

Currently cargo-clippy calls the associated cargo installd clippy-driver. Now that we ship clippy-preview, we can instead make it call the one from rustup!

Currently I have to hack this together to run clippy with clippy-preview: https://twitter.com/ManishEarth/status/1015818090548944896

$ CARGO_MANIFEST_DIR=. ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/clippy-driver src/main.rs --emit=dep-info,metadata 

We can use ${RUSTUP_HOME}/toolchains/${RUSTUP_TOOLCHAIN} to find the driver. Alternatively, we perhaps can do something like rustfmt so that it's in the path (not sure how this works)

Perhaps we should be shipping cargo-clippy via rustup too? This is what rustfmt does, and it's one fewer step for installing clippy.

cc @kennytm @oli-obk

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions