From nobody Thu Jun 11 21:24:10 2026 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 36ABA480335 for ; Wed, 3 Jun 2026 14:20:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780496457; cv=none; b=YLlFI3zfIVwYbSqnkUo3TIBBrMfmd++m4D1ZIBCNLOStFQ6R5sfSh9L2l+ovtQVfkqBaqL+p4dNRP6Jult6UVw2Ex4AMtQ+L5UWKu8acVCTsXnW0f+lB/t/JuebmxKUEXruBnMaIZ6xIuetsH3LWptzYSGm9bcYRt0q06603MYk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780496457; c=relaxed/simple; bh=ZSLPqVt61lctJzxaTevXiN/ykp7A7nTIEl3D0342UJE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=IwNqnLxPZWSKKqN2bE37Xx50NHrBFgsr7kziKLWOP9GK9/y7lWFJSRVzGVG49czroiLhAp58RM0N6J7w3b0loQGn0s/X+x55V+brha1L84WU8kjdZLcH4M5gbuDmZqu2Q0fHnJFHUpr3fugKpz04XD1ieStd8BfM/TPw8Ad+HKE= 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=Acpba8M8; arc=none smtp.client-ip=209.85.128.42 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="Acpba8M8" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-490b915ded5so6061055e9.3 for ; Wed, 03 Jun 2026 07:20:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780496454; x=1781101254; 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=58tXNk3LREvDeN550oLDB8Z8oduiuPvGtjNz4oAA8zg=; b=Acpba8M8TTiT31lp7nWg1TRDZdoaADBD+NCOXPpSWLtAuSzgidHD2QPsSbkch2MRO0 QFYgVUHNOo9aBlIR7/yB7prqbhHnQxxYjMB7yItiigCLZjJbxZ+Lk+EbcPNaUqHbqX0+ FrTIcvemV0s0t9SU33HmuFr18ztHgDZGym3CkOF7/JaOn0l5XWHr1AzeCNWkMflr8LPf nHu8+xprRCh+RRJUdmsdXSNeDg7CbOAVlcTHmKssiK7I+dYPKOZ06rZd92WEYY4jYTRX 4NHCIQGx9YTh6bQUV8Dajqnp/NkCVN+VJDizPvVj3JCPYry9/974GDzWN3jqUwXngWAL +MTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780496454; x=1781101254; 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=58tXNk3LREvDeN550oLDB8Z8oduiuPvGtjNz4oAA8zg=; b=Nf/y+wGDpaYiDOmbZaYoNyyp058McDyf9oRWUjHDURqlnfkLgNO6g36rd/pTg4g4ga q42hSW/X8CYrdOFnBT5lnLohAuDe4xmFI3KYnKK6iWWzzYyaywCgIVh0wbrWBrFIu0Ja xZUkgyTwnUKIEQb3k5eQCnweExpYK4w4FXx5pIv+LiRkOPSox7N/ZKXuvdZ1dqSdOq95 TTnD/sr4p8MIp6vQKrkMBF5kQpE07MouotnCcWSJBnxZ9XuRHL9f30eG787d+q/cP/l2 cHmxifbigtUzDoMU3v8SyDRzDWuO1L+HFC0NyzJ06QlY0B96Ql16eL6lmj5U7NmNSuea N/0g== X-Forwarded-Encrypted: i=1; AFNElJ9PQs5aEtUHQBp5mWeuhSVH6wNvRbr8ee0H9MrR1SYJ0Whc6qvv/tmHv4cBIy/UrRQcW1LEnLR4P25BqXg=@vger.kernel.org X-Gm-Message-State: AOJu0YxH58c+b8G1gWffm0PGNraZ41Ngh554tpcvukR68gTriBKNt6DX 1TNhEdDm4x6zFrXeTfNptw8EYkr9apjbCDKFk6p8u/aRK+ePGuHCM2oQA2P+aTre X-Gm-Gg: Acq92OHyhvczLGvDUL3dHxK/LcgA4WaJdA7/kkwAhUFklwHWxB7Mpt9/uWWhc0xmQpM gQgleajvdj9tNt+EbfZlHy2uHCk7mdQvY9sCFtz3LGQX7DSfhgEtiYZakZbZLhsN6QrkU/Gr6Bj z8gTOiRf2goTmNVukxlc+B7bzP5QJHwLhvZy6O/vG04sr3nOZ+pPhpSwdPt/M13KEaUVw6kDLEA 6/7lvm2cmXiNYU7A3gqEVYriNZGFT/gvdbJxvaLuq+fyU+husiVKutcRViDuiNm7NjgZk3aCo2m j8YRdFt3aCjcgt9HzA5sICgsfv27gauQJoh1xdRX+NCCkHSapBNTv/otCC3iC+Xvc+r52RLnhbt f6CBVUhAikl//vTXjcv4p9/LP9fzdf5GD9FMy4PFlQb6r4HgQZkxIGEf0BSrkiD3cnGDx6L041l 5m8oyWHe/TQ8CFIpvg7Xr0jTsvzJ5Xg6rZPnxEBivqMA== X-Received: by 2002:a05:600c:c10a:b0:490:b9c3:6c45 with SMTP id 5b1f17b1804b1-490b9c36e39mr31839545e9.18.1780496453582; Wed, 03 Jun 2026 07:20:53 -0700 (PDT) Received: from [172.16.16.15] ([195.100.225.50]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490b615fac0sm57420215e9.4.2026.06.03.07.20.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Jun 2026 07:20:53 -0700 (PDT) From: Malte Wechter Date: Wed, 03 Jun 2026 16:20:51 +0200 Subject: [PATCH v3] 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: <20260603-rust-analyzer-macro-v3-1-9f7fdb4908e5@gmail.com> X-B4-Tracking: v=1; b=H4sIAAAAAAAC/23NTQqDMBCG4avIrJuSjD+1XfUepYsYJxpQUxIba sW7NwoFFy7fD+aZGTw5Qx5uyQyOgvHGDjHSUwKqlUNDzNSxATkWPOcFc28/MjnIbvqSY71UzjJ EnZYXXZLWGcTLlyNtPpv6eMZujR+tm7YnQazr3ysPvSCYYFeBWF0zXnOe3ptemu6sbA+rF3BnI D82MBqV0nlVk5JCir2xLMsP7B+hI/oAAAA= 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 , David Gow 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=1780496452; l=2077; i=maltewechter@gmail.com; s=20260417; h=from:subject:message-id; bh=ZSLPqVt61lctJzxaTevXiN/ykp7A7nTIEl3D0342UJE=; b=JFrZEIjFXOiTLUi41JfkWba3fTV7metGLKH8V532++u+O4uHyft1tkIvcZnZ++fHQrXAZmZ7q I0lQqLkfpXeDTBCX8ESHh1C3JP6N+gt+3f174c/hw0RwJk+Mz2Tjh+r 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. Fixes: 36174d16f3ec ("rust: kunit: support KUnit-mapped `assert!` macros in= `#[test]`s") 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 v3: - Add fixes tag - Link to v2: https://lore.kernel.org/r/20260520-rust-analyzer-macro-v2-1-b= cf5bdeca1a1@gmail.com 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