public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jesung Yang" <y.j3ms.n@gmail.com>
To: engineer.jjhama@gmail.com, "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>
Cc: <rust-for-linux@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"Jesung Yang" <y.j3ms.n@gmail.com>
Subject: Re: [PATCH v2] scripts: generate_rust_analyzer: fix resolution of #[pin_data] macros
Date: Sat, 24 Jan 2026 09:43:09 +0900	[thread overview]
Message-ID: <DFWEIHKOKVQS.1MGF5PHL2JFVT@gmail.com> (raw)
In-Reply-To: <20260123-fix-pin-init-crate-dependecies-v2-1-bb1c2500e54c@gmail.com>

On Fri Jan 23, 2026 at 10:18 PM KST, SeungJong Ha via B4 Relay wrote:
> 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>

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?

Thanks!

[1] https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tag/?h=next-20260122

Best regards,
Jesung

> ---
> 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,


  parent reply	other threads:[~2026-01-24  0:43 UTC|newest]

Thread overview: 7+ 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 via B4 Relay
2026-01-23 15:42 ` Tamir Duberstein
2026-01-23 16:50 ` Gary Guo
2026-01-24  0:43 ` Jesung Yang [this message]
2026-01-24  2:14   ` 하승종
2026-01-24  5:00     ` Jesung Yang
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=DFWEIHKOKVQS.1MGF5PHL2JFVT@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox