diff --git a/docs/markdown/snippets/clippy.md b/docs/markdown/snippets/clippy.md index 14bcc77428a1..47d02083a0ab 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 7542fb6283a2..d88441dffcd7 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