From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CCF101CF7D5 for ; Sat, 24 Jan 2026 00:43:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769215398; cv=none; b=eOO1kakiirrRk39Oip+zYaihbmsUfn7o2TljNSdTxbOXFX+Ts5GZE20fAXzxtU5UjhZzVvf/oJy1KVIWxgTvKLewKO3GwzJ3sKoIxmjiYmQ4k4qVEdnxZi/vAGvvQKb9juB+0oo1JhJowd1Fh+LY0uQtzh1E0hnbXssGldfvxy0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769215398; c=relaxed/simple; bh=s5VV63214L9aIiNsY3Fe8HQ3oqoyNK56ChxQOloSsDE=; h=Mime-Version:Content-Type:Date:Message-Id:Cc:Subject:From:To: References:In-Reply-To; b=gGIoWbEGnucj5Ij8mvHAjHqmhViULGgB2VFeMeFUTVRGy6WceBMQFSPpJotKiVDjEOSn0mBduYTz9+j4mzRHOosNBkcOTN+NI+xLX+339nO1MORn6+riBNTr1FjNxk5Mvx3qU6dMFtsF/HKdakEq4W+jWrw+CirByIPSy9wEBxs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=bjNLZ1g/; arc=none smtp.client-ip=209.85.210.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bjNLZ1g/" Received: by mail-pf1-f193.google.com with SMTP id d2e1a72fcca58-8230f2140beso1011180b3a.1 for ; Fri, 23 Jan 2026 16:43:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769215394; x=1769820194; darn=vger.kernel.org; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=0I/aezjnuokBoW73JjqOvyELDq6BbD0cmw6CfuUW49Y=; b=bjNLZ1g/TReJHYCehU/9kynZpYpjKl86pn/hfExzw6Grj8e/IL1oEGLWWoLZs/svrg JC3abmU2JSZX2GH1JdEWF+Ya1qArgl1rl5NTKf3hA2hCh1ULAbfPQAO53kv6L3j754+L MOo1bvpPKBo8P1JQco8emXOmwCRvz1WYBwUt8IrywmUQ3YLzQx+iaEkfrdJVDXYb2S5e pz+ZcAYr4sVFvh6kXiraYqJv7squ18R/XSWAWGQmkVsHoVJJyPxW2USPk/3S0BAv4N3L G2Nww+Cgm1Yy6CRU1pCDETL68UH5n9dhGq8jh/cAXE6hsKzg8CU6X7AzdSoqw99Z0kjd WqIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769215394; x=1769820194; h=in-reply-to:references:to:from:subject:cc:message-id:date :content-transfer-encoding:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=0I/aezjnuokBoW73JjqOvyELDq6BbD0cmw6CfuUW49Y=; b=GSVTrcafmz1JLM13GEgQlR0UvLvlUN6gqCR0XNJFUxuH7Ynz62GrR4UdYwe2RhMTj9 418sSI02y44uKp2BXwdLJgVQ/GF3Ixmz4xH1KlEn1pJKT7+TnRUgUCLXctJSdJzK0sS7 SAWz9FTfLnbKfiWlSZdJFGCyWcAEj+uHpYSznAhQPVXe5vitbPOSyhzriJRpcAsIRT2h 8/kmamdkYZFaRWIjm00lrlC+zApT2DVz/PjC6FJgZ1k+z4OYqlRoqrPEEhEr1Fp5empB FSHBaaPSX7B5/yEdI42n5wK9oySCAfBQCTNFLQCmrbb+LpjaKuCFm/XQnlKo1pvW7czD HEOQ== X-Forwarded-Encrypted: i=1; AJvYcCVQrzprfEQmcqGMrTxSCR7o7Rp3jp8kb7PQH7wFdKGwObJeTWq4dtdJBw1R/zLvwYk0+Mvg2UTeMa8eQ5E=@vger.kernel.org X-Gm-Message-State: AOJu0YzRMGCZO0Y7HLT2H/FQGcZ8ha39CgAxbSrh+n1LiSr1YlWZ62KC /R/0I+UhLKrCDZBun4a/OclRQbu6KAxdtIbaAXHPVT4aSj0NfXUSZMmg X-Gm-Gg: AZuq6aISbcrQBF4hHC8bf3IW/YI1P5lzLEOEPMg6G7GQykMyQQx12xJj1ZlGrGjf1BN g8sLmhuJuZqW9q9bqNuEc5tbdBggpTdZvrpfq2NHZrA6aTsdX8hHGJ0wik0kiwO2WokLrr32wHd 1nTAZw4+Rg5AQIzbX1TtyllLP777szK5v0ghrKj7dNEGBOZgeQvO12sYpGWb5Ch3SWnryV1f4cX ecGqlVl4DEAY+gtELlL+a2y2SxiGB/lWaCLRt5IdTNUOJrjErSiyHE+ilfZro4rsrLamTpPQNT3 tJ3cXKz10f1SGfX1IZJGB1CfjhmIEQAsvt+aQg0Nt7vsDw09SBMQ7Ni2mCPzY4Sw1PK1hHu4jYJ x6Pgr0AsmppbBaOLJU+U5y7NoqXgTzYj48PE/J0Nbl27RxxeIpcDmrE3jk9cRFDNBG/r3vsAP1u aYqWFLnA== X-Received: by 2002:a05:6300:8b0f:b0:2ab:a456:9b09 with SMTP id adf61e73a8af0-38e6ffb5d6bmr4298433637.15.1769215393768; Fri, 23 Jan 2026 16:43:13 -0800 (PST) Received: from localhost ([112.149.32.52]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a802de5cf8sm29576655ad.42.2026.01.23.16.43.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Jan 2026 16:43:13 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sat, 24 Jan 2026 09:43:09 +0900 Message-Id: Cc: , , "Jesung Yang" Subject: Re: [PATCH v2] scripts: generate_rust_analyzer: fix resolution of #[pin_data] macros From: "Jesung Yang" To: , "Miguel Ojeda" , "Boqun Feng" , "Gary Guo" , =?utf-8?q?Bj=C3=B6rn_Roy_Baron?= , "Benno Lossin" , "Andreas Hindborg" , "Alice Ryhl" , "Trevor Gross" , "Danilo Krummrich" , "Tamir Duberstein" X-Mailer: aerc 0.21.0 References: <20260123-fix-pin-init-crate-dependecies-v2-1-bb1c2500e54c@gmail.com> 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 > > 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 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=3Dnext-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-depen= decies-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_an= alyzer.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, ex= ternal_src, cfgs, core_edit > append_crate( > name, > path, > - ["core", "kernel"], > + ["core", "kernel", "pin_init"], > cfg=3Dcfg, > ) > =20 > > --- > base-commit: 6d7fef23043553336259211346b6b135d6c1f4c3 > change-id: 20260123-fix-pin-init-crate-dependecies-b94ac4247a48 > > Best regards,