mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
rust: pin-init: internal: skip rustfmt formatting of kernel-only module
The `quote` module only is available in the kernel and thus running
`cargo fmt` or `rustfmt internal/src/lib.rs` in the user-space
repository [1] results in:
error: couldn't read `~/pin-init/internal/src/../../../macros/quote.rs`: No such file or directory (os error 2)
--> ~/pin-init/internal/src/lib.rs:25:1
|
25 | mod quote;
| ^^^^^^^^^^
Error writing files: failed to resolve mod `quote`: ~/pin-init/internal/src/../../../macros/quote.rs does not exist
Thus mark it with `rustfmt::skip` when compiling without kernel support.
Link: https://github.com/Rust-for-Linux/pin-init [1]
Link: a6caf1945e
Link: https://lore.kernel.org/all/20250414195928.129040-2-benno.lossin@proton.me
Reviewed-by: Christian Schrefl <chrisi.schrefl@gmail.com>
Signed-off-by: Benno Lossin <benno.lossin@proton.me>
This commit is contained in:
parent
2cce50f5ab
commit
31005209b8
1 changed files with 1 additions and 0 deletions
|
@ -22,6 +22,7 @@ use proc_macro::TokenStream;
|
|||
#[cfg(kernel)]
|
||||
#[path = "../../../macros/quote.rs"]
|
||||
#[macro_use]
|
||||
#[cfg_attr(not(kernel), rustfmt::skip)]
|
||||
mod quote;
|
||||
#[cfg(not(kernel))]
|
||||
#[macro_use]
|
||||
|
|
Loading…
Add table
Reference in a new issue