public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] scripts: generate_rust_analyzer: fix resolution of #[pin_data] macros
@ 2026-01-23 13:18 SeungJong Ha via B4 Relay
  2026-01-23 15:42 ` Tamir Duberstein
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: SeungJong Ha via B4 Relay @ 2026-01-23 13:18 UTC (permalink / raw)
  To: Miguel Ojeda, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Andreas Hindborg, Alice Ryhl, Trevor Gross,
	Danilo Krummrich
  Cc: rust-for-linux, linux-kernel, Jesung Yang, SeungJong Ha

From: SeungJong Ha <engineer.jjhama@gmail.com>

Currently, rust-analyzer fails to properly resolve structs annotated with
`#[pin_data]`. This prevents IDE features like "Go to Definition" from
working correctly for those structs.

Add the missing configuration to `generate_rust_analyzer.py` to ensure
the `pin-init` crate macros are handled correctly.

Signed-off-by: SeungJong Ha <engineer.jjhama@gmail.com>
---
I encountered an issue where rust-analyzer fails to analyze
structs decorated with the #[pin_data] attribute while testing
Rust kernel modules.

It appears that the dependencies for pin-init and drivers were
missing from the analyzer's configuration. This patch adds
those missing dependencies.

I have verified that my rust-analyzer correctly processes
\#[pin_data] structs after applying this fix.

Best regards, SeungJong
---
Changes in v2:
- Fix typos
- Drop the quote module workaround (will be handled separately)
- Rebase onto `rust-fixes`
- Add `pin_init` dependency for Rust drivers
- Link to v1: https://lore.kernel.org/r/20260123-fix-pin-init-crate-dependecies-v1-1-1c6cfe9aa352@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 3b645da90092..766c2d91cd81 100755
--- a/scripts/generate_rust_analyzer.py
+++ b/scripts/generate_rust_analyzer.py
@@ -214,7 +214,7 @@ def generate_crates(srctree, objtree, sysroot_src, external_src, cfgs, core_edit
             append_crate(
                 name,
                 path,
-                ["core", "kernel"],
+                ["core", "kernel", "pin_init"],
                 cfg=cfg,
             )
 

---
base-commit: 6d7fef23043553336259211346b6b135d6c1f4c3
change-id: 20260123-fix-pin-init-crate-dependecies-b94ac4247a48

Best regards,
-- 
SeungJong Ha <engineer.jjhama@gmail.com>



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

end of thread, other threads:[~2026-01-26  3:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-23 13:18 [PATCH v2] scripts: generate_rust_analyzer: fix resolution of #[pin_data] macros SeungJong Ha via B4 Relay
2026-01-23 15:42 ` Tamir Duberstein
2026-01-23 16:50 ` Gary Guo
2026-01-24  0:43 ` Jesung Yang
2026-01-24  2:14   ` 하승종
2026-01-24  5:00     ` Jesung Yang
2026-01-26  3:13 ` Miguel Ojeda

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