about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-01-12 15:11:08 +0000
committerbors <bors@rust-lang.org>2022-01-12 15:11:08 +0000
commitb9cae79d7fb18d797ae1472ac03b89a5fda17091 (patch)
tree76498cc370d85fba99d4f6cc3a2f4d857cc2d71c
parentae01c4ab3c0c9aa65ebb943075eb127646f3c672 (diff)
parent3d4fdedd7ee52ad660ccc0f9f713aeac9b21b8d0 (diff)
downloadrust-b9cae79d7fb18d797ae1472ac03b89a5fda17091.tar.gz
rust-b9cae79d7fb18d797ae1472ac03b89a5fda17091.zip
Auto merge of #8037 - ojeda:doc-codegen-change, r=camsteffen
`README`: document that Clippy may change codegen

Currently, Clippy does not guarantee the same codegen will be produced.
Therefore, it should not be used as an universal replacement for `rustc`.

See https://github.com/rust-lang/rust-clippy/issues/8035.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

fixes #8035
changelog: document that Clippy may change codegen
-rw-r--r--README.md20
1 files changed, 8 insertions, 12 deletions
diff --git a/README.md b/README.md
index de72e8d124d..f001a42d917 100644
--- a/README.md
+++ b/README.md
@@ -37,8 +37,8 @@ Table of contents:
 
 ## Usage
 
-Below are instructions on how to use Clippy as a subcommand, compiled from source
-or in Travis CI.
+Below are instructions on how to use Clippy as a cargo subcommand,
+in projects that do not use cargo, or in Travis CI.
 
 ### As a cargo subcommand (`cargo clippy`)
 
@@ -98,22 +98,18 @@ 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`)
+### Using `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:
-
-```terminal
-rustc --edition 2018 -Cpanic=abort foo.rs
-```
-
-Then, to enable Clippy, you will need to call:
+Clippy can also be used in projects that do not use cargo. To do so, run `clippy-driver`
+with the same arguments you use for `rustc`. For example:
 
 ```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 `clippy-driver` is designed for running Clippy only and should not be used as a general
+replacement for `rustc`. `clippy-driver` may produce artifacts that are not optimized as expected,
+for example.
 
 ### Travis CI