[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <DFWJZ6YFON1W.2Z2MYYEPLP2WN@gmail.com>
Date: Sat, 24 Jan 2026 14:00:04 +0900
From: "Jesung Yang" <y.j3ms.n@...il.com>
To: 하승종 <engineer.jjhama@...il.com>,
"Jesung Yang" <y.j3ms.n@...il.com>
Cc: "Miguel Ojeda" <ojeda@...nel.org>, "Boqun Feng" <boqun.feng@...il.com>,
"Gary Guo" <gary@...yguo.net>, Björn Roy Baron
<bjorn3_gh@...tonmail.com>, "Benno Lossin" <lossin@...nel.org>, "Andreas
Hindborg" <a.hindborg@...nel.org>, "Alice Ryhl" <aliceryhl@...gle.com>,
"Trevor Gross" <tmgross@...ch.edu>, "Danilo Krummrich" <dakr@...nel.org>,
"Tamir Duberstein" <tamird@...nel.org>, <rust-for-linux@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v2] scripts: generate_rust_analyzer: fix resolution of
#[pin_data] macros
On Sat Jan 24, 2026 at 11:14 AM KST, 하승종 wrote:
> 2026년 1월 24일 (토) AM 9:43, Jesung Yang <y.j3ms.n@...il.com>님이 작성:
[...]
>> Perhaps I'm missing something, but I wasn't able to reproduce this
>> problem (which I think is expected as the `kernel` crate already depends
>> on `pin_init`) with the following setup:
>>
>> Tree: linux-next (next-20260122) [1]
>> (includes latest changes from `rust-fixes` and `pin-init-next`)
>> Files: samples/rust/rust_*.rs, specifically rust_configfs.rs
>> rust-analyzer: 2024-04-29 (which corresponds to our MSRV), 2026-01-12
>>
>> Could you share your environment details and a minimal reproducible
>> example?
>
> Sure! Here are the details of my environment:
> Tree: rust-fixes (commit a44bfed) [2]
> rust-analyzer: The latest stable release (managed by the Zed IDE
> default channel).
>
> verified the issue with the following modules:
> - samples/rust/rust_configfs.rs
> - drivers/block/rnull/rnull.rs
>
> My reproduction steps were:
> 1. Without the patch: Hovering over structs annotated with #[pin_data]
> (e.g., RustConfigfs, NullBlkModule) provided no information/diagnostics.
> 2. "Go to Definition" on those symbols also failed to locate the definition.
> 3. After applying this patch and restarting the LSP server, both
> actions succeeded.
I've discovered that rust-analyzer fails to resolve
`#[pin_data]`-annotated structs if (and only if) we compile our
proc-macros, which essentially feeds `*.so` files to rust-analyzer. If
we don't compile anything, it resolves those structs correctly (despite
some diagnostic errors, if enabled).
This issue appears to be related to rust-analyzer's proc-macro expansion
logic, but anyway, this simple patch restores the IDE functionality. So,
Reviewed-by: Jesung Yang <y.j3ms.n@...il.com>
Thanks!
Best regards,
Jesung
Powered by blists - more mailing lists