aboutsummaryrefslogtreecommitdiffstats
path: root/rust/Makefile
diff options
context:
space:
mode:
authorMiguel Ojeda <ojeda@kernel.org>2024-11-23 19:06:38 +0100
committerMiguel Ojeda <ojeda@kernel.org>2025-01-10 00:17:25 +0100
commit2a87f8b075ea0ba33d3809aee7980c019f920bd6 (patch)
tree432eb26ca46cc8cd6492ae18e77ac41a0b038d07 /rust/Makefile
parentrust: give Clippy the minimum supported Rust version (diff)
downloadlinux-2a87f8b075ea0ba33d3809aee7980c019f920bd6.tar.gz
linux-2a87f8b075ea0ba33d3809aee7980c019f920bd6.zip
rust: kbuild: run Clippy for `rusttest` code
Running Clippy for `rusttest` code is useful to catch issues there too, even if the code is not as critical. In the future, this code may also run in kernelspace and could be copy-pasted. Thus it is useful to keep it under the same standards. For instance, it will now make us add `// SAFETY` comments. It also makes everything more consistent. Thus clean the few issues spotted by Clippy and start running it. Reviewed-by: Alice Ryhl <aliceryhl@google.com> Link: https://lore.kernel.org/r/20241123180639.260191-1-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'rust/Makefile')
-rw-r--r--rust/Makefile8
1 files changed, 4 insertions, 4 deletions
diff --git a/rust/Makefile b/rust/Makefile
index a40a3936126d..161e7cf67c97 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -116,10 +116,10 @@ rustdoc-kernel: $(src)/kernel/lib.rs rustdoc-core rustdoc-ffi rustdoc-macros \
$(obj)/bindings.o FORCE
+$(call if_changed,rustdoc)
-quiet_cmd_rustc_test_library = RUSTC TL $<
+quiet_cmd_rustc_test_library = $(RUSTC_OR_CLIPPY_QUIET) TL $<
cmd_rustc_test_library = \
OBJTREE=$(abspath $(objtree)) \
- $(RUSTC) $(rust_common_flags) \
+ $(RUSTC_OR_CLIPPY) $(rust_common_flags) \
@$(objtree)/include/generated/rustc_cfg $(rustc_target_flags) \
--crate-type $(if $(rustc_test_library_proc),proc-macro,rlib) \
--out-dir $(objtree)/$(obj)/test --cfg testlib \
@@ -187,10 +187,10 @@ quiet_cmd_rustdoc_test_kernel = RUSTDOC TK $<
# We cannot use `-Zpanic-abort-tests` because some tests are dynamic,
# so for the moment we skip `-Cpanic=abort`.
-quiet_cmd_rustc_test = RUSTC T $<
+quiet_cmd_rustc_test = $(RUSTC_OR_CLIPPY_QUIET) T $<
cmd_rustc_test = \
OBJTREE=$(abspath $(objtree)) \
- $(RUSTC) --test $(rust_common_flags) \
+ $(RUSTC_OR_CLIPPY) --test $(rust_common_flags) \
@$(objtree)/include/generated/rustc_cfg \
$(rustc_target_flags) --out-dir $(objtree)/$(obj)/test \
-L$(objtree)/$(obj)/test \