mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency
@ 2025-11-25  9:32 Jesung Yang
  2025-11-25  9:33 ` [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies Jesung Yang
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Jesung Yang @ 2025-11-25  9:32 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	rust-for-linux, linux-kernel, Jesung Yang

Fix the `generate_rust_analyzer.py` script to ensure that the
`rust-project.json` it produces includes `std` in the `deps` field for
the `syn` crate.

`syn` directly references items from `std`, so rust-analyzer should
treat it as a dependency to provide correct IDE support.

For example, `syn::Punctuated` contains fields of type `Vec<..>` and
`Option<..>`, both of which come from the standard library prelude.
With `std` listed in the `deps` field, rust-analyzer can infer the types
of these fields instead of showing `{unknown}`.

Verified the explicit uses of `std` using:

    grep -rn 'std::' rust/syn/

Fixes: 737401751ace ("rust: syn: enable support in kbuild")
Signed-off-by: Jesung Yang <y.j3ms.n@gmail.com>
---
 scripts/generate_rust_analyzer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
index 147d0cc94068..3b169904ee41 100755
--- a/scripts/generate_rust_analyzer.py
+++ b/scripts/generate_rust_analyzer.py
@@ -103,7 +103,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
     append_crate(
         "syn",
         srctree / "rust" / "syn" / "lib.rs",
-        ["proc_macro", "proc_macro2", "quote"],
+        ["std", "proc_macro", "proc_macro2", "quote"],
         cfg=crates_cfgs["syn"],
     )
 

base-commit: 54e3eae855629702c566bd2e130d9f40e7f35bde
-- 
2.47.3


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies
  2025-11-25  9:32 [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency Jesung Yang
@ 2025-11-25  9:33 ` Jesung Yang
  2026-01-05 10:48   ` Tamir Duberstein
  2025-11-25 23:57 ` [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency Miguel Ojeda
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Jesung Yang @ 2025-11-25  9:33 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Boqun Feng, Gary Guo, Björn Roy Baron, Benno Lossin,
	Andreas Hindborg, Alice Ryhl, Trevor Gross, Danilo Krummrich,
	rust-for-linux, linux-kernel, Jesung Yang

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@gmail.com>
---
Unlike [PATCH 1/2], this change doesn't seem to offer a noticeable
benefit at the moment, but I've included it for completeness.
---
 scripts/generate_rust_analyzer.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
index 3b169904ee41..b8080febc4bd 100755
--- a/scripts/generate_rust_analyzer.py
+++ b/scripts/generate_rust_analyzer.py
@@ -96,7 +96,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
     append_crate(
         "quote",
         srctree / "rust" / "quote" / "lib.rs",
-        ["alloc", "proc_macro", "proc_macro2"],
+        ["core", "alloc", "std", "proc_macro", "proc_macro2"],
         cfg=crates_cfgs["quote"],
     )

--
2.47.3


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency
  2025-11-25  9:32 [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency Jesung Yang
  2025-11-25  9:33 ` [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies Jesung Yang
@ 2025-11-25 23:57 ` Miguel Ojeda
  2025-11-26  4:13   ` Jesung Yang
  2026-01-05 10:49 ` Tamir Duberstein
  2026-01-18 19:43 ` Miguel Ojeda
  3 siblings, 1 reply; 15+ messages in thread
From: Miguel Ojeda @ 2025-11-25 23:57 UTC (permalink / raw)
  To: Jesung Yang
  Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, rust-for-linux, linux-kernel

On Tue, Nov 25, 2025 at 10:38 AM Jesung Yang <y.j3ms.n@gmail.com> wrote:
>
> Fix the `generate_rust_analyzer.py` script to ensure that the
> `rust-project.json` it produces includes `std` in the `deps` field for
> the `syn` crate.
>
> `syn` directly references items from `std`, so rust-analyzer should
> treat it as a dependency to provide correct IDE support.
>
> For example, `syn::Punctuated` contains fields of type `Vec<..>` and
> `Option<..>`, both of which come from the standard library prelude.
> With `std` listed in the `deps` field, rust-analyzer can infer the types
> of these fields instead of showing `{unknown}`.
>
> Verified the explicit uses of `std` using:
>
>     grep -rn 'std::' rust/syn/
>
> Fixes: 737401751ace ("rust: syn: enable support in kbuild")
> Signed-off-by: Jesung Yang <y.j3ms.n@gmail.com>

For something like this I am tempted to rebase, but given you took the
effort to write a nice commit message, I can apply them.

Let's see if someone else can confirm this works for them and gives a tag.

Thanks!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency
  2025-11-25 23:57 ` [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency Miguel Ojeda
@ 2025-11-26  4:13   ` Jesung Yang
  0 siblings, 0 replies; 15+ messages in thread
From: Jesung Yang @ 2025-11-26  4:13 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, rust-for-linux, linux-kernel

On Wed, Nov 26, 2025 at 8:57 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> For something like this I am tempted to rebase, but given you took the
> effort to write a nice commit message, I can apply them.

Feel free to rebase if that works better for you. I wrote those
messages just to provide enough context. Thanks for considering the
effort!

Best Regards,
Jesung

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies
  2025-11-25  9:33 ` [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies Jesung Yang
@ 2026-01-05 10:48   ` Tamir Duberstein
  2026-01-05 12:12     ` Jesung Yang
  0 siblings, 1 reply; 15+ messages in thread
From: Tamir Duberstein @ 2026-01-05 10:48 UTC (permalink / raw)
  To: Jesung Yang
  Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, rust-for-linux, linux-kernel

On Tue, Nov 25, 2025 at 4:38 AM Jesung Yang <y.j3ms.n@gmail.com> 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@gmail.com>

I think quote doesn't need std, see
https://github.com/dtolnay/quote/pull/318 which removes the last tiny
usages.

> ---
> Unlike [PATCH 1/2], this change doesn't seem to offer a noticeable
> benefit at the moment, but I've included it for completeness.
> ---
>  scripts/generate_rust_analyzer.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
> index 3b169904ee41..b8080febc4bd 100755
> --- a/scripts/generate_rust_analyzer.py
> +++ b/scripts/generate_rust_analyzer.py
> @@ -96,7 +96,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
>      append_crate(
>          "quote",
>          srctree / "rust" / "quote" / "lib.rs",
> -        ["alloc", "proc_macro", "proc_macro2"],
> +        ["core", "alloc", "std", "proc_macro", "proc_macro2"],
>          cfg=crates_cfgs["quote"],
>      )
>
> --
> 2.47.3
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency
  2025-11-25  9:32 [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency Jesung Yang
  2025-11-25  9:33 ` [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies Jesung Yang
  2025-11-25 23:57 ` [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency Miguel Ojeda
@ 2026-01-05 10:49 ` Tamir Duberstein
  2026-01-18 19:43 ` Miguel Ojeda
  3 siblings, 0 replies; 15+ messages in thread
From: Tamir Duberstein @ 2026-01-05 10:49 UTC (permalink / raw)
  To: Jesung Yang
  Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, rust-for-linux, linux-kernel

On Tue, Nov 25, 2025 at 4:38 AM Jesung Yang <y.j3ms.n@gmail.com> wrote:
>
> Fix the `generate_rust_analyzer.py` script to ensure that the
> `rust-project.json` it produces includes `std` in the `deps` field for
> the `syn` crate.
>
> `syn` directly references items from `std`, so rust-analyzer should
> treat it as a dependency to provide correct IDE support.
>
> For example, `syn::Punctuated` contains fields of type `Vec<..>` and
> `Option<..>`, both of which come from the standard library prelude.
> With `std` listed in the `deps` field, rust-analyzer can infer the types
> of these fields instead of showing `{unknown}`.
>
> Verified the explicit uses of `std` using:
>
>     grep -rn 'std::' rust/syn/
>
> Fixes: 737401751ace ("rust: syn: enable support in kbuild")
> Signed-off-by: Jesung Yang <y.j3ms.n@gmail.com>

Reviewed-by: Tamir Duberstein <tamird@gmail.com>
Tested-by: Tamir Duberstein <tamird@gmail.com>

> ---
>  scripts/generate_rust_analyzer.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_analyzer.py
> index 147d0cc94068..3b169904ee41 100755
> --- a/scripts/generate_rust_analyzer.py
> +++ b/scripts/generate_rust_analyzer.py
> @@ -103,7 +103,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
>      append_crate(
>          "syn",
>          srctree / "rust" / "syn" / "lib.rs",
> -        ["proc_macro", "proc_macro2", "quote"],
> +        ["std", "proc_macro", "proc_macro2", "quote"],
>          cfg=crates_cfgs["syn"],
>      )
>
>
> base-commit: 54e3eae855629702c566bd2e130d9f40e7f35bde
> --
> 2.47.3
>
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies
  2026-01-05 10:48   ` Tamir Duberstein
@ 2026-01-05 12:12     ` Jesung Yang
  2026-01-05 14:06       ` Miguel Ojeda
  0 siblings, 1 reply; 15+ messages in thread
From: Jesung Yang @ 2026-01-05 12:12 UTC (permalink / raw)
  To: Tamir Duberstein
  Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, rust-for-linux, linux-kernel

On Mon, Jan 5, 2026 at 7:49 PM Tamir Duberstein <tamird@gmail.com> wrote:
> On Tue, Nov 25, 2025 at 4:38 AM Jesung Yang <y.j3ms.n@gmail.com> 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@gmail.com>
>
> 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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies
  2026-01-05 12:12     ` Jesung Yang
@ 2026-01-05 14:06       ` Miguel Ojeda
  2026-01-05 15:23         ` Tamir Duberstein
  2026-01-05 15:30         ` Jesung Yang
  0 siblings, 2 replies; 15+ messages in thread
From: Miguel Ojeda @ 2026-01-05 14:06 UTC (permalink / raw)
  To: Jesung Yang
  Cc: Tamir Duberstein, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, rust-for-linux, linux-kernel

On Mon, Jan 5, 2026 at 1:12 PM Jesung Yang <y.j3ms.n@gmail.com> wrote:
>
> 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.

What are the advantages/disadvantages of doing so? Performance in rust-analyzer?

In general, I would prefer to avoid patching vendored dependencies,
but if there is an advantage, then I think it is fine to have small
changes as long as upstream has merged their PR (i.e. so that we at
least know there is a good chance we will eventually get the same
change when we upgrade the dependency).

Thanks!

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies
  2026-01-05 14:06       ` Miguel Ojeda
@ 2026-01-05 15:23         ` Tamir Duberstein
  2026-01-05 15:30         ` Jesung Yang
  1 sibling, 0 replies; 15+ messages in thread
From: Tamir Duberstein @ 2026-01-05 15:23 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Jesung Yang, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, rust-for-linux, linux-kernel

On Mon, Jan 5, 2026 at 9:06 AM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Mon, Jan 5, 2026 at 1:12 PM Jesung Yang <y.j3ms.n@gmail.com> wrote:
> >
> > 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.
>
> What are the advantages/disadvantages of doing so? Performance in rust-analyzer?
>
> In general, I would prefer to avoid patching vendored dependencies,
> but if there is an advantage, then I think it is fine to have small
> changes as long as upstream has merged their PR (i.e. so that we at
> least know there is a good chance we will eventually get the same
> change when we upgrade the dependency).
>
> Thanks!
>
> Cheers,
> Miguel

Yeah, I wouldn't rush to patch the vendored copy. We could just
knowingly give up on the IDE support in this tiny corner (assuming
upstream takes my patch). FWIW the only degradation here is that RA
wouldn't see the ToTokens impls for CStr and CString.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies
  2026-01-05 14:06       ` Miguel Ojeda
  2026-01-05 15:23         ` Tamir Duberstein
@ 2026-01-05 15:30         ` Jesung Yang
  2026-01-09 21:47           ` Jesung Yang
  1 sibling, 1 reply; 15+ messages in thread
From: Jesung Yang @ 2026-01-05 15:30 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Tamir Duberstein, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, rust-for-linux, linux-kernel

On Mon, Jan 5, 2026 at 11:06 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> On Mon, Jan 5, 2026 at 1:12 PM Jesung Yang <y.j3ms.n@gmail.com> wrote:
> >
> > 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.
>
> What are the advantages/disadvantages of doing so? Performance in rust-analyzer?

There's no noticeable performance improvement, at least in my setup.
Even though it seems desired, for now I don't think there is a clear
benefit, as `syn` is currently only used in the macros crate which
already depends on `std`. For the same reason, keeping the `std`
dependency in `syn` does not cause actual harm for the time being.

> In general, I would prefer to avoid patching vendored dependencies,
> but if there is an advantage, then I think it is fine to have small
> changes as long as upstream has merged their PR (i.e. so that we at
> least know there is a good chance we will eventually get the same
> change when we upgrade the dependency).

I think applying this series as-is and revisiting the `std` removal
when we eventually upgrade `syn` (so that the PR effectively lands in
our vendored `syn`) is also an option. If there's no upcoming upgrade
planned for the near future, I would personally prefer this approach.

Best regards,
Jesung

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies
  2026-01-05 15:30         ` Jesung Yang
@ 2026-01-09 21:47           ` Jesung Yang
  2026-01-09 22:17             ` Tamir Duberstein
  0 siblings, 1 reply; 15+ messages in thread
From: Jesung Yang @ 2026-01-09 21:47 UTC (permalink / raw)
  To: Miguel Ojeda, Tamir Duberstein
  Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, rust-for-linux, linux-kernel

On Tue, Jan 6, 2026 at 12:30 AM Jesung Yang <y.j3ms.n@gmail.com> wrote:
>
> I think applying this series as-is and revisiting the `std` removal
> when we eventually upgrade `syn` (so that the PR effectively lands in
> our vendored `syn`) is also an option. If there's no upcoming upgrade
> planned for the near future, I would personally prefer this approach.

Ok, [1] has been merged to the upstream...

I don't have a strong opinion, but I still think it is more natural to
drop the `std` dependency when we actually bump our vendored `syn` to a
version that includes the merged changes.

Miguel, Tamir, what do you think?

[1] https://github.com/dtolnay/quote/pull/318

Best regards,
Jesung

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies
  2026-01-09 21:47           ` Jesung Yang
@ 2026-01-09 22:17             ` Tamir Duberstein
  2026-01-09 22:33               ` Jesung Yang
  0 siblings, 1 reply; 15+ messages in thread
From: Tamir Duberstein @ 2026-01-09 22:17 UTC (permalink / raw)
  To: Jesung Yang
  Cc: Miguel Ojeda, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, rust-for-linux, linux-kernel

On Fri, Jan 9, 2026 at 4:47 PM Jesung Yang <y.j3ms.n@gmail.com> wrote:
>
> On Tue, Jan 6, 2026 at 12:30 AM Jesung Yang <y.j3ms.n@gmail.com> wrote:
> >
> > I think applying this series as-is and revisiting the `std` removal
> > when we eventually upgrade `syn` (so that the PR effectively lands in
> > our vendored `syn`) is also an option. If there's no upcoming upgrade
> > planned for the near future, I would personally prefer this approach.
>
> Ok, [1] has been merged to the upstream...
>
> I don't have a strong opinion, but I still think it is more natural to
> drop the `std` dependency when we actually bump our vendored `syn` to a
> version that includes the merged changes.
>
> Miguel, Tamir, what do you think?
>
> [1] https://github.com/dtolnay/quote/pull/318
>
> Best regards,
> Jesung

We have to keep the std dep -- see
https://github.com/dtolnay/quote/commit/009af09c8252bf687e7f49e281fc47bc7d3c0749.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies
  2026-01-09 22:17             ` Tamir Duberstein
@ 2026-01-09 22:33               ` Jesung Yang
  2026-01-09 23:08                 ` Tamir Duberstein
  0 siblings, 1 reply; 15+ messages in thread
From: Jesung Yang @ 2026-01-09 22:33 UTC (permalink / raw)
  To: Tamir Duberstein
  Cc: Miguel Ojeda, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, rust-for-linux, linux-kernel

On Sat, Jan 10, 2026 at 7:18 AM Tamir Duberstein <tamird@gmail.com> wrote:
>
> We have to keep the std dep -- see
> https://github.com/dtolnay/quote/commit/009af09c8252bf687e7f49e281fc47bc7d3c0749.

Ah, I see. Thanks for the link.

So IIUC, this series is good to go as-is? If so, I'd appreciate your
tags for the `quote` patch as well if you're happy with it.

Best regards,
Jesung

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies
  2026-01-09 22:33               ` Jesung Yang
@ 2026-01-09 23:08                 ` Tamir Duberstein
  0 siblings, 0 replies; 15+ messages in thread
From: Tamir Duberstein @ 2026-01-09 23:08 UTC (permalink / raw)
  To: Jesung Yang
  Cc: Miguel Ojeda, Miguel Ojeda, Boqun Feng, Gary Guo,
	Björn Roy Baron, Benno Lossin, Andreas Hindborg, Alice Ryhl,
	Trevor Gross, Danilo Krummrich, rust-for-linux, linux-kernel

On Fri, Jan 9, 2026 at 5:33 PM Jesung Yang <y.j3ms.n@gmail.com> wrote:
>
> On Sat, Jan 10, 2026 at 7:18 AM Tamir Duberstein <tamird@gmail.com> wrote:
> >
> > We have to keep the std dep -- see
> > https://github.com/dtolnay/quote/commit/009af09c8252bf687e7f49e281fc47bc7d3c0749.
>
> Ah, I see. Thanks for the link.
>
> So IIUC, this series is good to go as-is? If so, I'd appreciate your
> tags for the `quote` patch as well if you're happy with it.
>
> Best regards,
> Jesung

Sure.

Reviewed-by: Tamir Duberstein <tamird@gmail.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency
  2025-11-25  9:32 [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency Jesung Yang
                   ` (2 preceding siblings ...)
  2026-01-05 10:49 ` Tamir Duberstein
@ 2026-01-18 19:43 ` Miguel Ojeda
  3 siblings, 0 replies; 15+ messages in thread
From: Miguel Ojeda @ 2026-01-18 19:43 UTC (permalink / raw)
  To: Jesung Yang
  Cc: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich, rust-for-linux, linux-kernel

On Tue, Nov 25, 2025 at 10:38 AM Jesung Yang <y.j3ms.n@gmail.com> wrote:
>
> Fix the `generate_rust_analyzer.py` script to ensure that the
> `rust-project.json` it produces includes `std` in the `deps` field for
> the `syn` crate.
>
> `syn` directly references items from `std`, so rust-analyzer should
> treat it as a dependency to provide correct IDE support.
>
> For example, `syn::Punctuated` contains fields of type `Vec<..>` and
> `Option<..>`, both of which come from the standard library prelude.
> With `std` listed in the `deps` field, rust-analyzer can infer the types
> of these fields instead of showing `{unknown}`.
>
> Verified the explicit uses of `std` using:
>
>     grep -rn 'std::' rust/syn/
>
> Fixes: 737401751ace ("rust: syn: enable support in kbuild")
> Signed-off-by: Jesung Yang <y.j3ms.n@gmail.com>

Applied (both in the series) to `rust-fixes` -- thanks everyone!

    [ Reworded title. - Miguel ]

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-01-18 19:43 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-25  9:32 [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency Jesung Yang
2025-11-25  9:33 ` [PATCH 2/2] rust: quote: make rust-analyzer treat `core` and `std` as dependencies Jesung Yang
2026-01-05 10:48   ` Tamir Duberstein
2026-01-05 12:12     ` Jesung Yang
2026-01-05 14:06       ` Miguel Ojeda
2026-01-05 15:23         ` Tamir Duberstein
2026-01-05 15:30         ` Jesung Yang
2026-01-09 21:47           ` Jesung Yang
2026-01-09 22:17             ` Tamir Duberstein
2026-01-09 22:33               ` Jesung Yang
2026-01-09 23:08                 ` Tamir Duberstein
2025-11-25 23:57 ` [PATCH 1/2] rust: syn: make rust-analyzer treat `std` as a dependency Miguel Ojeda
2025-11-26  4:13   ` Jesung Yang
2026-01-05 10:49 ` Tamir Duberstein
2026-01-18 19:43 ` Miguel Ojeda

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®