diff options
| author | Paolo Bonzini <pbonzini@redhat.com> | 2024-11-17 08:40:22 +0100 |
|---|---|---|
| committer | Dylan Baker <dylan@pnwbakers.com> | 2024-12-19 09:25:20 -0800 |
| commit | 1f1a6d3a45ab968bbc28854c4733dc1303abb176 (patch) | |
| tree | c83237c34f1984f248671896162875e48a91573a | |
| parent | 5768ccba6eb77167da96712c20a4e042efb31d03 (diff) | |
| download | meson-1f1a6d3a45ab968bbc28854c4733dc1303abb176.tar.gz | |
rust: raise a warning if clippy is used instead of rustc
clippy-driver is not meant to be a general-purpose compiler front-end.
Since Meson can now provide natively the ability to invoke clippy,
raise a warning if someone uses it that way.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
| -rw-r--r-- | docs/markdown/snippets/clippy.md | 3 | ||||
| -rw-r--r-- | mesonbuild/compilers/detect.py | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/docs/markdown/snippets/clippy.md b/docs/markdown/snippets/clippy.md index 14bcc7742..47d02083a 100644 --- a/docs/markdown/snippets/clippy.md +++ b/docs/markdown/snippets/clippy.md @@ -3,3 +3,6 @@ Meson now defines a `clippy` target if the project uses the Rust programming language. The target runs clippy on all Rust sources, using the `clippy-driver` program from the same Rust toolchain as the `rustc` compiler. + +Using `clippy-driver` as the Rust compiler will now emit a warning, as it +is not meant to be a general-purpose compiler front-end. diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index 7542fb628..d88441dff 100644 --- a/mesonbuild/compilers/detect.py +++ b/mesonbuild/compilers/detect.py @@ -1042,6 +1042,10 @@ def detect_rust_compiler(env: 'Environment', for_machine: MachineChoice) -> Rust version = search_version(out) cls = rust.ClippyRustCompiler + mlog.deprecation( + 'clippy-driver is not intended as a general purpose compiler. ' + 'You can use "ninja clippy" in order to run clippy on a ' + 'meson project.') if 'rustc' in out: # On Linux and mac rustc will invoke gcc (clang for mac |
