mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:24:47 +01:00
rust: proc-macro2: enable support in kbuild
With all the new files in place and ready from the new crate, enable the support for it in the build system. `proc_macro_byte_character` and `proc_macro_c_str_literals` were stabilized in Rust 1.79.0 [1] and were implemented earlier than our minimum Rust version (1.78) [2][3]. Thus just enable them instead of using the `cfg` that `proc-macro2` uses to emulate them in older compilers. In addition, skip formatting for this vendored crate and take the chance to add a comment mentioning this. Link: https://github.com/rust-lang/rust/pull/123431 [1] Link: https://github.com/rust-lang/rust/pull/112711 [2] Link: https://github.com/rust-lang/rust/pull/119651 [3] 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-11-ojeda@kernel.org Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
This commit is contained in:
parent
bc1565efc3
commit
158a3b7211
3 changed files with 42 additions and 2 deletions
5
Makefile
5
Makefile
|
|
@ -1826,10 +1826,15 @@ rusttest: prepare
|
|||
$(Q)$(MAKE) $(build)=rust $@
|
||||
|
||||
# Formatting targets
|
||||
#
|
||||
# Generated files as well as vendored crates are skipped.
|
||||
PHONY += rustfmt rustfmtcheck
|
||||
|
||||
rustfmt:
|
||||
$(Q)find $(srctree) $(RCS_FIND_IGNORE) \
|
||||
\( \
|
||||
-path $(srctree)/rust/proc-macro2 \
|
||||
\) -prune -o \
|
||||
-type f -a -name '*.rs' -a ! -name '*generated*' -print \
|
||||
| xargs $(RUSTFMT) $(rustfmt_flags)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue