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

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®