Skip to content

Commit

Permalink
README: clippy-driver is not a replacement for rustc
Browse files Browse the repository at this point in the history
Currently, `clippy-driver` may run codegen, but this is an
implementation detail.

See rust-lang#8035.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
  • Loading branch information
ojeda committed Dec 14, 2021
1 parent aa3648a commit 8481f61
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,23 @@ If you want to run Clippy **only** on the given crate, use the `--no-deps` optio
cargo clippy -p example -- --no-deps
```

### As a rustc replacement (`clippy-driver`)
### Projects that do not use cargo (`clippy-driver`)

Clippy can also be used in projects that do not use cargo. To do so, you will need to replace
your `rustc` compilation commands with `clippy-driver`. For example, if your project runs:
Clippy can also be used in projects that do not use cargo. To do so, invoke `clippy-driver`
with the same compilation commands you use for `rustc`. For example, if your project runs:

```terminal
rustc --edition 2018 -Cpanic=abort foo.rs
```

Then, to enable Clippy, you will need to call:
Then, to run Clippy, you will need to run:

```terminal
clippy-driver --edition 2018 -Cpanic=abort foo.rs
```

Note that `rustc` will still run, i.e. it will still emit the output files it normally does.
Note that you should still use `rustc` for compilation: it is an implementation detail whether
`clippy-driver` runs codegen or not (and if it does, it may be different than what `rustc` outputs).

### Travis CI

Expand Down

0 comments on commit 8481f61

Please sign in to comment.