Re: [PATCH] scripts: generate_rust_analyzer.py: add missing macros -> core dep
From: Miguel Ojeda
Date: Sun Feb 09 2025 - 11:29:39 EST
Hi Tamir,
Thanks for looking into rust-analyzer, it is great to get improvements
in this area.
On Sun, Feb 9, 2025 at 4:29 PM Tamir Duberstein <tamird@xxxxxxxxx> wrote:
>
> The macros crate has depended on core since its introduction in commit
To be clear, `macros` does not depend on the (kernel) `core`. But it
depends on host crates: not just `core`, but `proc_macro`, `std` etc.,
which is why we can use things like e.g. `std::fmt::Write`, right? I
don't know if the distinction matters for rust-analyzer, though, but
things like their `cfg`s may differ.
I also wonder if we should also be passing `std` etc. given it seems
we need to pass `core`. Does it handle correctly that `Write`, for
instance? Perhaps rust-analyzer allows to pass different sets of
crates for this, even if they share the same display name -- then we
could pass the right `cfg`s and so on.
Cc'ing Lukas and Danilo who have been looking into rust-analyzer
support recently (Fiona is already there).
One more quick comment: since this would apply to all proc macros,
should we do it for all proc macros? i.e. instead of hardcoding it
here, using instead the `is_proc_macro` tag we already have.
Cheers,
Miguel