Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rust: kbuild: introduce `core-flags` and `core-skip_flags`

In the next commits we are introducing `*-{cfgs,skip_flags,flags}`
variables for other crates.

Thus do so here for `core`, which simplifies a bit the `Makefile`
(including the next commit) and makes it more consistent.

This means we stop passing `-Wrustdoc::unescaped_backticks` to `rustc`
and `-Wunreachable_pub` to `rustdoc`, i.e. we skip more, which is fine
since it shouldn't have an effect.

In addition, use `:=` for `core-cfgs` to make it consistent with the
upcoming additions.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Tested-by: Gary Guo <gary@garyguo.net>
Tested-by: Jesung Yang <y.j3ms.n@gmail.com>
Link: https://patch.msgid.link/20251124151837.2184382-2-ojeda@kernel.org
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>

+14 -5
+14 -5
rust/Makefile
··· 60 60 rustdoc_test_kernel_quiet=>/dev/null 61 61 endif 62 62 63 - core-cfgs = \ 63 + core-cfgs := \ 64 64 --cfg no_fp_fmt_parse 65 65 66 66 core-edition := $(if $(call rustc-min-version,108700),2024,2021) 67 + 68 + core-skip_flags := \ 69 + --edition=2021 \ 70 + -Wunreachable_pub \ 71 + -Wrustdoc::unescaped_backticks 72 + 73 + core-flags := \ 74 + --edition=$(core-edition) \ 75 + $(core-cfgs) 67 76 68 77 # `rustdoc` did not save the target modifiers, thus workaround for 69 78 # the time being (https://github.com/rust-lang/rust/issues/144521). ··· 131 122 132 123 # Starting with Rust 1.82.0, skipping `-Wrustdoc::unescaped_backticks` should 133 124 # not be needed -- see https://github.com/rust-lang/rust/pull/128307. 134 - rustdoc-core: private skip_flags = --edition=2021 -Wrustdoc::unescaped_backticks 135 - rustdoc-core: private rustc_target_flags = --edition=$(core-edition) $(core-cfgs) 125 + rustdoc-core: private skip_flags = $(core-skip_flags) 126 + rustdoc-core: private rustc_target_flags = $(core-flags) 136 127 rustdoc-core: $(RUST_LIB_SRC)/core/src/lib.rs rustdoc-clean FORCE 137 128 +$(call if_changed,rustdoc) 138 129 ··· 508 499 $(obj)/exports.o: private skip_gendwarfksyms = 1 509 500 510 501 $(obj)/core.o: private skip_clippy = 1 511 - $(obj)/core.o: private skip_flags = --edition=2021 -Wunreachable_pub 502 + $(obj)/core.o: private skip_flags = $(core-skip_flags) 512 503 $(obj)/core.o: private rustc_objcopy = $(foreach sym,$(redirect-intrinsics),--redefine-sym $(sym)=__rust$(sym)) 513 - $(obj)/core.o: private rustc_target_flags = --edition=$(core-edition) $(core-cfgs) 504 + $(obj)/core.o: private rustc_target_flags = $(core-flags) 514 505 $(obj)/core.o: $(RUST_LIB_SRC)/core/src/lib.rs \ 515 506 $(wildcard $(objtree)/include/config/RUSTC_VERSION_TEXT) FORCE 516 507 +$(call if_changed_rule,rustc_library)