Re: [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies

From: Jesung Yang
Date: Mon Jan 05 2026 - 07:24:58 EST


On Mon, Jan 5, 2026 at 7:49 PM Tamir Duberstein <tamird@xxxxxxxxx> wrote:
> On Tue, Nov 25, 2025 at 4:38 AM Jesung Yang <y.j3ms.n@xxxxxxxxx> wrote:
> >
> > Fix the `generate_rust_analyzer.py` script to ensure that the
> > `rust-project.json` it produces includes `core` and `std` in the `deps`
> > field for the `quote` crate.
> >
> > `quote` directly references items from both `core` and `std`, so
> > rust-analyzer should treat them as dependencies to provide correct IDE
> > support.
> >
> > For example, the `::quote::ToTokens` trait is implemented for
> > `std::ffi::CString`. With `std` listed in the `deps` field,
> > rust-analyzer can show the expected autocomplete for the
> > `::quote::ToTokens` methods on `std::ffi::CString`.
> >
> > Verified the explicit uses of `core` and `std` using:
> >
> > grep -rnE 'core::|std::' rust/quote/
> >
> > Fixes: 88de91cc1ce7 ("rust: quote: enable support in kbuild")
> > Signed-off-by: Jesung Yang <y.j3ms.n@xxxxxxxxx>
>
> I think quote doesn't need std, see
> https://github.com/dtolnay/quote/pull/318 which removes the last tiny
> usages.

IIUC, to remove `std`, we need to patch our vendored `syn` as well to
not depend on `std`, right? I think it is indeed a desired change.

If you don't mind, I'm happy to patch the vendored `syn` along with
this series if the team agrees. Alternatively, if you'd prefer to send
the patch yourself, please let me know.

Best regards,
Jesung