From nobody Mon May 25 00:55:39 2026 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (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 2211F392C5F for ; Wed, 20 May 2026 07:47:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779263248; cv=none; b=hhpa0P6/rHQX/eupkkAwQxqBBMwSv+csxG5LMojEwtnLORyYwUkcLWpKt8LZ1XJF5I+IQbC1i+QzCEdBW7wbuZpRBeCNyYzJ3hajDGlgwlBRENCpFMxUkKpGs8OKGzEwK7C4bUNamiR24+HCBfz1cp5nnfaHQBNiJ/eD89OVibU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779263248; c=relaxed/simple; bh=0UKYns+nR+ySVSzxIxiko6WAtELM2fCZwIlWFYrPDh4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=o+MuVIypG1qstRH2X85kQkK0APvUOM2qOeO6vLTLokfXXWjxFXAAOiRNZQ7lINZK8xOt3cuRbUIAa32V1wahUud32g0DZasdcQetGdnBHZe0JaRHn5rf/Xm+B1I9snTvmU8ie9yvgNerNccuMTl0Hknk0/QrE4l/H21R0Q8Nnlc= 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=CSIRSo2Q; arc=none smtp.client-ip=209.85.128.46 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="CSIRSo2Q" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-488a9033b2cso36667965e9.2 for ; Wed, 20 May 2026 00:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779263244; x=1779868044; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=UhoHBzW0YBQ4lxgfg4HswZGmxJ5x4IyqPjbt/WLXKcM=; b=CSIRSo2QZA5qQPKFmWLcrzYWPxYZeShZjhvKS1CHqbzjCJ9UCfubSaP/iY9Ih08qol FZLCveCSm7h8FCyYJD0kXbFDmvR1WWiDreVTcskOQe0hxR8PaM3KnWmF3I/l8hW6qAzj k+/SQd+e4i7RLSNK6r+xpxTD9HIQqYIyDjEHgHo55UPs6G96nlFvWUzfdKrqUxypTuUW 61j0nk7t2jbvKvY8ZUdAwoS4vwJDUsyW8pXFeRd+hciqnD+Lyzv9HaYzA4mgDMSju9La 9Iw+yyQKL6gz9lEva7Hw6R5r4OPSSYysGacLoh6XwxgUbwUsmWu6JPpeBP+wapMJlTM4 +VOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779263244; x=1779868044; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=UhoHBzW0YBQ4lxgfg4HswZGmxJ5x4IyqPjbt/WLXKcM=; b=gNRfl6k3Z6OQWMcUuzCfly0hUO0sS6KKcMEIen9ICHnTnjGYtC3YEsUe3mRa6YBRUi yt+FFgq3byFnukmsLYeumflLyisSVUt+LB4qJaMQfbrIkWw0TgZ6BCHbWFUdaagA9t5C it3dVI0bHa51H0WuJzUl+0nSMdSZeC9BBONoCM5P8prGVST6f5J0ikMdZlo9F8mlhtdD YNC/C4gJ+GzMN++4+D+LqtMmu/ZksUtE6fshOEeu1vdiKUIB47PK0s3Xwwgv7c+902NF sCBP2cUHEMdovXEbCFQpnONDT77hH7mIKqPxczXI6XDXRfKO7ZR6xn5/iNxHy6+ofhH8 llZA== X-Forwarded-Encrypted: i=1; AFNElJ/j8yUHDECBe2gGGuiGhmp7tQHM6z5jjwxYhGaI24dlWIgZNGdTIQ9FQ6uLJcgzlCotq+z+i09ORNsMCJM=@vger.kernel.org X-Gm-Message-State: AOJu0YyejrQRaUsQNx1k3C5Vs+LEOIQeCYyUs8sQ0WWHicWx6ylzyv90 SaZUFiAmOeYs9PG/jM8Uba2rD8l0DCfohKpU6e++JbeoYti4ZbHp+bQU X-Gm-Gg: Acq92OGzbLxwa/i9SvHFvoFuy7eo4DkKnZu1SnW+3I51WZ+y2XfKut+64wj002k/c/R bWNMmdIB8fMxeW4ZBEDOO3kKtG1EA8nMsn0a4Lo9GPICX5JsgJQvwDaqeJqNw9SP15Kh+Ac1K1n WOAeMyZ1z12hSmoWTrd7AFhSdHw33/oBQWUDBUENNoo3ruThqmcttZnl/dWy/Q00OSZOYW91krk 6g05bafkbfsUmY9Bz39mV7BuUJGnDc0ZlPGJmzEr4e5tXRfvKyIzerLRtqdirLrQPyAPZr9Vx6c 6WFuFJv447Px1vzDA1uf3GL520wtSvMNOwW/X1zO9CSUreoLiixxoT15fBnOELEO+DBYZEh3UC+ CIIoF6VAFp0zb33K7ghrcgmm82jyD3q+lvmGtBs40H+coDbyzwLqgy0TaC1HeD9UHtaFJWtxdqG FsazBHY6KE+alZuEILB4rJ1TS457eUBN8= X-Received: by 2002:a05:600d:8496:10b0:48f:eb8b:9980 with SMTP id 5b1f17b1804b1-48feb8b9ademr222374065e9.30.1779263243420; Wed, 20 May 2026 00:47:23 -0700 (PDT) Received: from [172.16.16.15] ([195.100.225.50]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48fe4c88495sm372136795e9.4.2026.05.20.00.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2026 00:47:22 -0700 (PDT) From: Malte Wechter Date: Wed, 20 May 2026 09:47:20 +0200 Subject: [PATCH v2] rust-analyzer: update generate_rust_analyzer to pass cfg to macros crate Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260520-rust-analyzer-macro-v2-1-bcf5bdeca1a1@gmail.com> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/22NQQ6CMBBFr0JmbU07IIIr72FYVJjCJEDNFIlIu LuVxJ3L95L//gqBhCnAJVlBaObAfoyAhwTqzo4tKW4iA2rM9UnnSp5hUna0/fImUYOtxStElxZ nV5BzGcTlQ8jxa6/eqsgdh8nLsp/M5mt/veJvbzbKqNIg3stMN1qn13aw3B9rP0C1bdsH47hmh bYAAAA= X-Change-ID: 20260506-rust-analyzer-macro-22f387f8eff4 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 , Jesung Yang Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, Malte Wechter X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779263242; l=1851; i=maltewechter@gmail.com; s=20260417; h=from:subject:message-id; bh=0UKYns+nR+ySVSzxIxiko6WAtELM2fCZwIlWFYrPDh4=; b=4GC8ZOA4N7D9snyqpBhGgS3hhntoIUFF1JAgy8Hn88T7TvpHYLcc/mbYZQD1vssAzqJhUkoRu GKbkvcSX+/zDTj5Scty/4qItdlV5z6k1BOkr1E9c1diyWTdYaoX86tf X-Developer-Key: i=maltewechter@gmail.com; a=ed25519; pk=07WplWXZnwyLTMZOHNCIGcpoEutcMXU/JDY6f9VtxSY= The configuration passed to rust-analyzer for the `macros` create is different from the configuration used to build the crate. Update rust-analyzer configuration for the `macros` crate to reflect the settings used to compile the crate. Without this change, rust-analyzer does not understand conditional compilation gated by configuration redicates based on the `CONFIG_*`configuration values in the macros crate. Signed-off-by: Malte Wechter --- We are currently moving the 'configfs_attrs' macro to a procedual implement= ation, with this we wanted to gate the macro on CONFIG_CONFIGFS_FS, since the macr= os crate is build with these configurations since 36174d16 ("rust: kunit: support KUnit= -mapped `assert!` macros in `#[test]`s"). It compiles but rust-analyzer does not reflect this as adding: =20 #[cfg(CONFIG_CONFIGFS_FS)] mod configfs_attrs; will _never_ mark configfs_attrs module as included since the cfg's are not= passed to the macros crate. Changes in v2: - Update commit message - Link to v1: https://lore.kernel.org/r/20260508-rust-analyzer-macro-v1-1-9= 122b940d003@gmail.com --- scripts/generate_rust_analyzer.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/generate_rust_analyzer.py b/scripts/generate_rust_anal= yzer.py index d5f9a0ca742c..69990a96522e 100755 --- a/scripts/generate_rust_analyzer.py +++ b/scripts/generate_rust_analyzer.py @@ -238,6 +238,7 @@ def generate_crates( "macros", srctree / "rust" / "macros" / "lib.rs", [std, proc_macro, proc_macro2, quote, syn], + cfg=3Dgenerated_cfg, ) =20 build_error =3D append_crate( --- base-commit: 254f49634ee16a731174d2ae34bc50bd5f45e731 change-id: 20260506-rust-analyzer-macro-22f387f8eff4 Best regards, --=20 Malte Wechter