All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jesung Yang" <y.j3ms.n@gmail.com>
To: 하승종 <engineer.jjhama@gmail.com>, "Jesung Yang" <y.j3ms.n@gmail.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>,
	"Tamir Duberstein" <tamird@kernel.org>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] scripts: generate_rust_analyzer: fix resolution of #[pin_data] macros
Date: Sat, 24 Jan 2026 14:00:04 +0900	[thread overview]
Message-ID: <DFWJZ6YFON1W.2Z2MYYEPLP2WN@gmail.com> (raw)
In-Reply-To: <CAGAB6667fm45e9ZNg3FCAw-O_jV3cnK-gGfG=xe2ftPEQHxxgQ@mail.gmail.com>

On Sat Jan 24, 2026 at 11:14 AM KST, 하승종 wrote:
> 2026년 1월 24일 (토) AM 9:43, Jesung Yang <y.j3ms.n@gmail.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@gmail.com>

Thanks!

Best regards,
Jesung

  reply	other threads:[~2026-01-24  5:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-23 13:18 [PATCH v2] scripts: generate_rust_analyzer: fix resolution of #[pin_data] macros SeungJong Ha
2026-01-23 13:18 ` 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 [this message]
2026-01-26  3:13 ` Miguel Ojeda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DFWJZ6YFON1W.2Z2MYYEPLP2WN@gmail.com \
    --to=y.j3ms.n@gmail.com \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=engineer.jjhama@gmail.com \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tamird@kernel.org \
    --cc=tmgross@umich.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.