Re: [PATCH] rust-analyzer: update generate_rust_analyzer to pass cfg to macros crate
From: Tamir Duberstein
Date: Mon May 11 2026 - 10:47:21 EST
On Mon, May 11, 2026 at 1:00 AM Andreas Hindborg <a.hindborg@xxxxxxxxxx> wrote:
>
> Andreas Hindborg <a.hindborg@xxxxxxxxxx> writes:
>
> <cut>
>
> >> Directionally I think this patch is incorrect because the macros crate
> >> is a host-side crate and generated_cfg is for target-side cfgs.
> >
> > We might want to differentiate macro implementations based on kernel
> > configuration, or as in our case, skip compilation of certain macros
> > when they are not used in the kernel build.
>
> Also, the `macros` crate is actually built with these configuration
> attributes applied. It is only logical that the `rust-analyzer`
> configuration reflect how we build the crate.
Hi Andreas,
These justifications should be in the commit message. I agree that the
`macros` crate is receiving those cfgs, that was added in 36174d16
("rust: kunit: support KUnit-mapped `assert!` macros in `#[test]`s") -
this should also be mentioned in the commit message please.