Re: [PATCH v3 09/15] rust: pin-init: rewrite the initializer macros using `syn`
From: Tamir Duberstein
Date: Thu Jan 15 2026 - 19:19:57 EST
On Thu, Jan 15, 2026 at 5:43 PM Benno Lossin <lossin@xxxxxxxxxx> wrote:
>
> On Thu Jan 15, 2026 at 10:45 PM CET, Tamir Duberstein wrote:
> > On Wed, Jan 14, 2026 at 1:20 PM Benno Lossin <lossin@xxxxxxxxxx> wrote:
> >>
> >> Rewrite the initializer macros `[pin_]init!` using `syn`. No functional
> >> changes intended aside from improved error messages on syntactic and
> >> semantical errors. For example if one forgets to use `<-` with an
> >> initializer (and instead uses `:`):
> >>
> >> <snip>
> >>
> >> Tested-by: Andreas Hindborg <a.hindborg@xxxxxxxxxx>
> >> Signed-off-by: Benno Lossin <lossin@xxxxxxxxxx>
> >> ---
> >>
> >> <snip>
> >>
> >> -#[cfg(kernel)]
> >> -pub use ::macros::paste;
> >> -#[cfg(not(kernel))]
> >> -pub use ::paste::paste;
> >
> > Now that `cfg(kernel)` is gone, can we also remove it from `rust/Makefile`
> > and `scripts/generate_rust_analyzer.py`? That is already done for
> > pin-init in patch 3 of this series:
> > https://lore.kernel.org/all/20260114181934.1782470-4-lossin@xxxxxxxxxx/.
>
> I'm still using `cfg(kernel)` in `src/lib.rs` for linking to the std
> Box and Arc types.
Are you sure? I'm not seeing it. It looks like the crate is no_std
unless the std feature is activated and no features are activated in
the kernel.
> Also I don't want to have to reintroduce all that infrastructure when I
> inevitably have to add new kernel workarounds.
Then why remove it for pin-init?