From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3360328751B; Sun, 5 Apr 2026 23:53:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433220; cv=none; b=VeRYExPcxw85g++/ktTZeJsDejrKW4N1i5vVTZBuWQPlsfQFsOVVEXETepAsmpyrAnQzbAIfNuwTqLcYNMe+Z4pRV9i//zAUaSG/gOyAztkoDa6a3cvdJIofoxMcG0BWJMO5kQtBPedzwrNxsc6anjayb/eM2sHSOzGpkPAr53M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433220; c=relaxed/simple; bh=5sbZC4LmoO0aslETTGIb1afN103Xm/S3EYSfsUuG440=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uSEiV0/1EKZ3OlSLxdbCdxfzoahO/VcY7rqew9oOsAHgRph4e0RwXXaWUn1FEV3E8fu2bDvK0FQC+eioxaP7jARRe1x6ljIYLGtEYAQJMkmV35DCJSnhWmVg5h+AvFYukNpp1PLscEexiU8RT00oPiecvaJRdTgdaqxNkaGLnpM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CbAtsUUb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CbAtsUUb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CADBC19425; Sun, 5 Apr 2026 23:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433219; bh=5sbZC4LmoO0aslETTGIb1afN103Xm/S3EYSfsUuG440=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CbAtsUUbjHdguSI6jhILScIxMOr5j1dFJhwr6cGmnDdLstMcNGvOTz4hy/tTuue7I PO4+sIdljkOukHZWwbd1hKG1frp8wLnJ1vgsLbyAnd7d44sht3YYb9TblhQHVhWSHN TQPybH7Bn2ybT78h5mceT9O7ySO5EjLFRf4FZpJCjaovLWMx54kG+talki7G4eBn9z mO8nX0O+8jb97CqgETBuathbX3zU/gIgkOXgIZ7gnENXuXWZawT6dl4bPTqN9PC/Gd JlPIkorQcEw8NVEf9b+Bd+qyL1ttWeLWAFxNsAAVGBToPmQ6LQ9/KkXqBU8PtZmcND 0LqCfQvAd2c/g== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH v2 01/33] rust: kbuild: remove `--remap-path-prefix` workarounds Date: Mon, 6 Apr 2026 01:52:37 +0200 Message-ID: <20260405235309.418950-2-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Commit 8cf5b3f83614 ("Revert "kbuild, rust: use -fremap-path-prefix to make paths relative"") removed `--remap-path-prefix` from the build system, so the workarounds are not needed anymore. Thus remove them. Note that the flag has landed again in parallel in this cycle in commit dda135077ecc ("rust: build: remap path to avoid absolute path"), together with `--remap-path-scope=3Dmacro` [1]. However, they are gated on `rustc-option-yn, --remap-path-scope=3Dmacro`, which means they are both only passed starting with Rust 1.95.0 [2]: `--remap-path-scope` is only stable in Rust 1.95, so use `rustc-option` to detect its presence. This feature has been available as `-Zremap-path-scope` for all versions that we support; however due to bugs in the Rust compiler, it does not work reliably until 1.94. I opted to not enable it for 1.94 as it's just a single version that we missed. In turn, that means the workarounds removed here should not be needed again (even with the flag added again above), since: - `rustdoc` now recognizes the `--remap-path-prefix` flag since Rust 1.81.0 [3] (even if it is still an unstable feature [4]). - The Internal Compiler Error [5] that the comment mentions was fixed in Rust 1.87.0 [6]. We tested that was the case in a previous version of this series by making the workaround conditional [7][8]. ...which are both older versions than Rust 1.95.0. We will still need to skip `--remap-path-scope` for `rustdoc` though, since `rustdoc` does not support that one yet [4]. Link: https://github.com/rust-lang/rust/issues/111540 [1] Link: https://github.com/rust-lang/rust/pull/147611 [2] Link: https://github.com/rust-lang/rust/pull/107099 [3] Link: https://doc.rust-lang.org/nightly/rustdoc/unstable-features.html#--re= map-path-prefix-remap-source-code-paths-in-output [4] Link: https://github.com/rust-lang/rust/issues/138520 [5] Link: https://github.com/rust-lang/rust/pull/138556 [6] Link: https://lore.kernel.org/rust-for-linux/20260401114540.30108-9-ojeda@k= ernel.org/ [7] Link: https://lore.kernel.org/rust-for-linux/20260401114540.30108-10-ojeda@= kernel.org/ [8] Signed-off-by: Miguel Ojeda Acked-by: Gary Guo Acked-by: Nicolas Schier Reviewed-by: Tamir Duberstein --- rust/Makefile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/rust/Makefile b/rust/Makefile index 96cd7d8e6ee9..16ea720e0a8e 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -145,14 +145,10 @@ rustdoc_modifiers_workaround :=3D $(if $(call rustc-m= in-version,108800),-Cunsafe-a # Similarly, for doctests (https://github.com/rust-lang/rust/issues/146465= ). doctests_modifiers_workaround :=3D $(rustdoc_modifiers_workaround)$(if $(c= all rustc-min-version,109100),$(comma)sanitizer) =20 -# `rustc` recognizes `--remap-path-prefix` since 1.26.0, but `rustdoc` only -# since Rust 1.81.0. Moreover, `rustdoc` ICEs on out-of-tree builds since = Rust -# 1.82.0 (https://github.com/rust-lang/rust/issues/138520). Thus workaroun= d both -# issues skipping the flag. The former also applies to `RUSTDOC TK`. quiet_cmd_rustdoc =3D RUSTDOC $(if $(rustdoc_host),H, ) $< cmd_rustdoc =3D \ OBJTREE=3D$(abspath $(objtree)) \ - $(RUSTDOC) $(filter-out $(skip_flags) --remap-path-prefix=3D%,$(if $(rust= doc_host),$(rust_common_flags),$(rust_flags))) \ + $(RUSTDOC) $(filter-out $(skip_flags),$(if $(rustdoc_host),$(rust_common_= flags),$(rust_flags))) \ $(rustc_target_flags) -L$(objtree)/$(obj) \ -Zunstable-options --generate-link-to-definition \ --output $(rustdoc_output) \ @@ -338,7 +334,7 @@ quiet_cmd_rustdoc_test_kernel =3D RUSTDOC TK $< rm -rf $(objtree)/$(obj)/test/doctests/kernel; \ mkdir -p $(objtree)/$(obj)/test/doctests/kernel; \ OBJTREE=3D$(abspath $(objtree)) \ - $(RUSTDOC) --test $(filter-out --remap-path-prefix=3D%,$(rust_flags)) \ + $(RUSTDOC) --test $(rust_flags) \ -L$(objtree)/$(obj) --extern ffi --extern pin_init \ --extern kernel --extern build_error --extern macros \ --extern bindings --extern uapi \ --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E7D334253B; Sun, 5 Apr 2026 23:53:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433231; cv=none; b=BMsPwPkq8PWO9hrvIK7gDP2bLGoMzDQD7w0UPuk9VJLsZrGi/+g6zygH4NHCuHO/OhrbBXW/+H48Klsm3g3IWxK4S1RG4QQxQwgOqnyfmRfHjui6lcDiPj+ShxqUa9yzgGia56tYdl4j2aPrsBZC6Cn115AHZ+oQ4yX9hd+qWM0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433231; c=relaxed/simple; bh=3AJRnAyEU2suxXGqceHWmfrdhCBJgg/viD//VN5No4A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iki9xENGOwDIXkaR8KayU1ZYXesqrgzW7Og/fJpkhJ4wF8kqymZ1rJ+b2gJT5e38dcUtOYOm5h90JlUdeCtXh0iLNSUv4DYqTR+rCU0WFzqP3G/i/0ql/ttA5OJm8xUd8y63lwdjwQVeiZcCsU7dAL2DMQupMoGuNlSi4VCt+go= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EwAXuYA2; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EwAXuYA2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5792AC116C6; Sun, 5 Apr 2026 23:53:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433231; bh=3AJRnAyEU2suxXGqceHWmfrdhCBJgg/viD//VN5No4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EwAXuYA25JGS9wsvKoXsGN6sAEKslnUZh5D1dRotUu99nhYgcoqpY6WYoCLhunn5n xHVYrx8rpK1rU+25XoZCWXvldDnU50XFCE9J47vhT2ZBF0UGNIKn4LeZfLphQ37F6o N1lVtDyk0UuzGU0HE91nvri0/O0pl3Q1uBMBgMuqqJFjAGhMQ/Ha1VCv/QoDDqC+Cx MRKnQoRQilcWK9zZs34qU1c15lT5egG9V0Rp4ouFrAMfz8ogTTbM8rXPpqWj7JccvG ZkUDGF0siAS7QeLkDf2sedkNJlP+8fmXP7k5sjXvvE3+l8wPpUZ/4xCTRIOfLlFB1U 2IJKROs43C4iQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 02/33] rust: kbuild: remove "`try` keyword" workaround for `bindgen` < 0.59.2 Date: Mon, 6 Apr 2026 01:52:38 +0200 Message-ID: <20260405235309.418950-3-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" There is a workaround that has not been needed, even already after commit 08ab786556ff ("rust: bindgen: upgrade to 0.65.1"), but it does not hurt. Thus remove it. Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- rust/bindgen_parameters | 4 ---- 1 file changed, 4 deletions(-) diff --git a/rust/bindgen_parameters b/rust/bindgen_parameters index fd2fd1c3cb9a..112ec197ef0a 100644 --- a/rust/bindgen_parameters +++ b/rust/bindgen_parameters @@ -15,10 +15,6 @@ --opaque-type x86_msi_data --opaque-type x86_msi_addr_lo =20 -# `try` is a reserved keyword since Rust 2018; solved in `bindgen` v0.59.2, -# commit 2aed6b021680 ("context: Escape the try keyword properly"). ---opaque-type kunit_try_catch - # If SMP is disabled, `arch_spinlock_t` is defined as a ZST which triggers= a Rust # warning. We don't need to peek into it anyway. --opaque-type spinlock --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9186638423D; Sun, 5 Apr 2026 23:54:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433242; cv=none; b=H4G7oy6YAn8osoaQdoQsoGdreJWAzi3SAJYcIcd2n2x7rFNjPrEG/Dn/hPH1xbXbJCAJ5Xr2XjPwKIQHNo/v+POV1uki9+ssTRCoFpnW5imdjvS8bmRgGmMhq5EwhMS/tnQTdtoQ/U6669AON7pfCpokWmQ24mIFm0SDnA40uwQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433242; c=relaxed/simple; bh=WQ0oBITAbznQlvSGXpQS73br2HMX6Bl0r6ccv/0kOtQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=njbdsOety4evcdfAd+QoX20eNKtPL0rB6yE0f7t9gkz6gkAplnyxvVQHC2V2H7AV+8PVIb7limTiYa797Gaex3SJ/F0S6oiMtaDREkSSRYe9Ew8FmrimuoGRAccHpgpncrQyQspAyJnW8kIWAZnMMPWvUwNAsEoZyHG2b/CU/Hc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ME0m/TLb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ME0m/TLb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BA5CC116C6; Sun, 5 Apr 2026 23:53:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433242; bh=WQ0oBITAbznQlvSGXpQS73br2HMX6Bl0r6ccv/0kOtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ME0m/TLbLLPkqVSK+iLGCx7Qa57ge0tZp/EzBj65jU7Gi+ERQSPKwf2Rr77wxXDNK RkuzSWWrTer5zZVSX7ZmfNpmGDHDw7AZNyURN5b/Ek393YiaAlqw2oFr05KY04oAsL +byIpV99QPfflerc2makyl1vZ5n/+4tGd3ni4/cv1L0w8FGwdTMh/La5YBban/5liF rXGoYtIzYujv6gOLZ0J7fGKgoDYlFWyFYbLrMQ922zNgC7RKaWG7Wpxf/bTSvu9QDC 6GF9afyHuSpq7uqaF+5GL7UIb7V7T5KnR79NZsLE7/OJgSJegLBz9pdg1DjD/JZ7yQ d+gllyV3biqBg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 03/33] rust: kbuild: remove unneeded old `allow`s for generated layout tests Date: Mon, 6 Apr 2026 01:52:39 +0200 Message-ID: <20260405235309.418950-4-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" The issue that required `allow`s for `cfg(test)` code generated by `bindgen` for layout testing was fixed back in `bindgen` 0.60.0 [1], so it could have been removed even before the version bump, but it does not hurt. Thus remove it now. Link: https://github.com/rust-lang/rust-bindgen/pull/2203 [1] Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- rust/bindings/lib.rs | 4 ---- rust/uapi/lib.rs | 4 ---- 2 files changed, 8 deletions(-) diff --git a/rust/bindings/lib.rs b/rust/bindings/lib.rs index 19f57c5b2fa2..e18c160dad17 100644 --- a/rust/bindings/lib.rs +++ b/rust/bindings/lib.rs @@ -9,10 +9,6 @@ //! using this crate. =20 #![no_std] -// See . -#![cfg_attr(test, allow(deref_nullptr))] -#![cfg_attr(test, allow(unaligned_references))] -#![cfg_attr(test, allow(unsafe_op_in_unsafe_fn))] #![allow( clippy::all, missing_docs, diff --git a/rust/uapi/lib.rs b/rust/uapi/lib.rs index 1d5fd9efb93e..821e286e0daa 100644 --- a/rust/uapi/lib.rs +++ b/rust/uapi/lib.rs @@ -8,10 +8,6 @@ //! userspace APIs. =20 #![no_std] -// See . -#![cfg_attr(test, allow(deref_nullptr))] -#![cfg_attr(test, allow(unaligned_references))] -#![cfg_attr(test, allow(unsafe_op_in_unsafe_fn))] #![allow( clippy::all, clippy::cast_lossless, --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 98700264A65; Sun, 5 Apr 2026 23:54:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433253; cv=none; b=uvltLkT5JqZi7oVrg4vnTTKYaABbsZyCY9KJeKaOtAw61l1GItzPeq7y1XEziEaACRcGCFCFbPTdS863sHW6ZhNdqQwLQ2h9HebirRkjCSueTo2IAa+24uYsRz+us8OVPczobFWkX/cms9+Txa8lsi8se3atmj6D7kdqDM773EI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433253; c=relaxed/simple; bh=oJiEjRp/opaguJ4HhOa7BUALrmAHlwil3WnDUUwEFyg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BQe0b1Twgq2pjCtsf9FGFLw4ZVT6aBseZB1bXd05JeHi6Pr7i9m3yx1/1PxaHfhEXfd4/hrU/XyXX35DdBf+q/b3dCZoc25E50u5g9X+ZsPCGIF/qphmZfBiqqTlISs1NNU9mHWFwhlDuFurZgeRiUfAQsySv832qeeEVYrb6yQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c10lWAwN; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c10lWAwN" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5734C19425; Sun, 5 Apr 2026 23:54:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433253; bh=oJiEjRp/opaguJ4HhOa7BUALrmAHlwil3WnDUUwEFyg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c10lWAwN7MLREejYSBh3vQLAgy//epBWc0tngWnnNsGINz8/8BlSPWfgahadGOvdg GJR/QGcckyY1VKHxNGRQhD/YyTL42GRWjDnY9CRlUt+Bx7rCq+inC36ss3LMkllx5C jCzn/1H+H3U2Udf/nYq4VGqSHLFJs5uBG1jN2j7ksPIuZQIwZS8T1ZqvFfTkCjXinf HwuRwkXS9MYDk6Pqlgm7p9mbcEhyyEKZ4di60v8j1CCV16s5WfaVl6n4/rqtJFA5Ag 9rs7/6aurHA4leXQgoMVliGbwR86JVtRyVkjWqwpFzYYP2uH4d8JIwQ8pbaJ3B9UHq QUN1C/k9eWL2g== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 04/33] gpu: nova-core: bindings: remove unneeded `cfg_attr` Date: Mon, 6 Apr 2026 01:52:40 +0200 Message-ID: <20260405235309.418950-5-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" These were likely copied from the `bindings` and `uapi` crates, but are unneeded since there are no `cfg(test)`s in the bindings. In addition, the issue that triggered the addition in those crates originally is also fixed in `bindgen` (please see the previous commit). Thus remove them. Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Acked-by: Danilo Krummrich Signed-off-by: Miguel Ojeda --- drivers/gpu/nova-core/gsp/fw/r570_144.rs | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/nova-core/gsp/fw/r570_144.rs b/drivers/gpu/nova-co= re/gsp/fw/r570_144.rs index e99d315ae74c..2e6f0d298756 100644 --- a/drivers/gpu/nova-core/gsp/fw/r570_144.rs +++ b/drivers/gpu/nova-core/gsp/fw/r570_144.rs @@ -7,9 +7,6 @@ //! This module may not be directly used. Please abstract or re-export the= needed symbols in the //! parent module instead. =20 -#![cfg_attr(test, allow(deref_nullptr))] -#![cfg_attr(test, allow(unaligned_references))] -#![cfg_attr(test, allow(unsafe_op_in_unsafe_fn))] #![allow( dead_code, clippy::all, --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96C12342146; Sun, 5 Apr 2026 23:54:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433264; cv=none; b=E4H8VscT85eYw/+QpsmocxPF83EdwJPV+nuNXkMSg3svx0O9IzuCmmcKM/zA0nUriLp+wKUJjNOJglit5RIL2Jh+eLEymjkz2BauZsjBIy2EZURxxoz6KPlsQLc+LI2nvO3xFt6saZtFROoTAFIa8dXTDnei4RxsP/F0HFHPtpU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433264; c=relaxed/simple; bh=7EaNnrhT/szhZgmliWeltWKXsYIB8rKqoUcWnLxYEoo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lQ0kKiJAxxEIVzDXLEQw5x7492XwfvdfXCe8UunsuOAFdMHjJGoRqEsPyur15TPRfkAaaNklHfrgjwHoTBhUl4wXSRdKO6EQ8sazi8H/QgrIeGmMJ0LcynXGIBnWbQloAvv/gxxX6ZZaOAggccheFXoo4RYQGPvtlSx9nRBIzqQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=D7CQsLxq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="D7CQsLxq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA9D6C19425; Sun, 5 Apr 2026 23:54:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433264; bh=7EaNnrhT/szhZgmliWeltWKXsYIB8rKqoUcWnLxYEoo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D7CQsLxqJs0ndvOCgx98FOGSkr0v/I+RAStdNRVkAkCCb+Een8p8LiCDfdFYL4BTb Xm1OMGlYEspj+sl85BmUzh0tacu6p2coTtSiUMi6/AmCV4O8+R1Gw7n15Y8mZZUB/F kUmixCM7jp6xAqaAb81FleCMQ6ygNusPafP4e2vCwiJrSgnruLNyyPeQs9N9yFBVLR llvS4s7+D5lfYxXlJYjgiBlRngKZpF0BWA7mmE7okMql1msLbIp4I8ansTCPmXaC+U SBt1pVwtNiWDdlmlhfeAbW7k4fAn2IGbHF7IqYZAWm4L+212N9igqjZw95yaYaduro Arc18nSaT0UOQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 05/33] rust: bump Rust minimum supported version to 1.85.0 (Debian Trixie) Date: Mon, 6 Apr 2026 01:52:41 +0200 Message-ID: <20260405235309.418950-6-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" As proposed in the past in e.g. LPC 2025 and the Maintainers Summit [1], we are going to follow Debian Stable's Rust versions as our minimum supported version. Debian Trixie was released with a Rust 1.85.0 toolchain [2], which it still uses to this day [3] (i.e. no update to Rust 1.85.1). Debian Trixie's release happened on 2025-08-09 [4], which means that a fair amount of time has passed since its release for kernel developers to upgrade. Thus bump the minimum to the new version. Then, in later commits, clean up most of the workarounds and other bits that this upgrade of the minimum allows us. pin-init was left as-is since the patches come from upstream. And the vendored crates are unmodified, since we do not want to change those. Note that the minimum LLVM major version for Rust 1.85.0 is LLVM 18 (the Rust upstream binaries use LLVM 19.1.7), thus e.g. `RUSTC_LLVM_VERSION` tests can also be updated, but there are no suitable ones to simplify. Ubuntu 25.10 also has a recent enough Rust toolchain [5], and they also provide versioned packages with a Rust 1.85.1 toolchain even back to Ubuntu 22.04 LTS [6]. Link: https://lwn.net/Articles/1050174/ [1] Link: https://www.debian.org/releases/trixie/release-notes/whats-new.en.htm= l#desktops-and-well-known-packages [2] Link: https://packages.debian.org/trixie/rustc [3] Link: https://www.debian.org/releases/trixie/ [4] Link: https://packages.ubuntu.com/search?suite=3Dall&searchon=3Dnames&keywo= rds=3Drustc [5] Link: https://launchpad.net/ubuntu/+source/rustc-1.85 [6] Acked-by: Tamir Duberstein Acked-by: Benno Lossin Acked-by: Gary Guo Acked-by: Danilo Krummrich Acked-by: Alice Ryhl Signed-off-by: Miguel Ojeda --- Documentation/process/changes.rst | 2 +- scripts/min-tool-version.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/process/changes.rst b/Documentation/process/chan= ges.rst index 6b373e193548..474594bd4831 100644 --- a/Documentation/process/changes.rst +++ b/Documentation/process/changes.rst @@ -31,7 +31,7 @@ you probably needn't concern yourself with pcmciautils. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D GNU C 8.1 gcc --version Clang/LLVM (optional) 15.0.0 clang --version -Rust (optional) 1.78.0 rustc --version +Rust (optional) 1.85.0 rustc --version bindgen (optional) 0.65.1 bindgen --version GNU make 4.0 make --version bash 4.2 bash --version diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh index 99b5575c1ef7..a270ec761f64 100755 --- a/scripts/min-tool-version.sh +++ b/scripts/min-tool-version.sh @@ -31,7 +31,7 @@ llvm) fi ;; rustc) - echo 1.78.0 + echo 1.85.0 ;; bindgen) echo 0.65.1 --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28CE638236D; Sun, 5 Apr 2026 23:54:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433276; cv=none; b=DnU2UxyfTAWoSb1rwdqpnIaTHLGhuz3m6T4MtWLTfxP19Y8FOMFNY7DVwobEyUTOdm4w/GuYV9UGslTIV3jIWjNE6wpXvqSVOtAW81cqvJSkX3eaSvvfmjp/BPLfL1ENEB4pFajvcUFlEFHXIu6FcMDZHOG4dlStUkJEkD1l2Bw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433276; c=relaxed/simple; bh=Blo4OMct9fYkxFdmel/7U9C+OpnsYmoKnhqmZOKw+4A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oPqld8hTAKFJP8YJUcBet31Qjs1dhOmBXwSniDNZyp9jWN5U0Y2PKgWGx94JcPkK6amcVyaWcX9+qnkFpMVw7LDcMJZAq2w62QnkJcqnDw6Ir7QKqiEKtOjkv6obZpb/hiXnJfKnuw16k1BUdpIPDP0H6WKBipiEgB3lFEBgOnI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cN/Pm+h1; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cN/Pm+h1" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 022B9C19425; Sun, 5 Apr 2026 23:54:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433275; bh=Blo4OMct9fYkxFdmel/7U9C+OpnsYmoKnhqmZOKw+4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cN/Pm+h1MNJIdF8/BGkOea6H77vXoucr8wI0WEa1JjgbUvhFtEz8eoHKetlw+QXz/ yKJO+pzg+gsG7x6RU/QXG3/NDSowmR9zbNCKxO2a/aJI+6JRSWJ7FlC/RdNHyNrNNL vkYkWnvMwABBEgYDSlwiUH1xGSN0AkwKOU2CezV3RZe4tdKCq5qAY+dKqINxZIBlio QPbluXudooBzD+JgtojrRNp/XPzmN19AXP+Mm5kqOBRju7q9dhhwB6RvmCMVM26hrH IFc9bvX9/tmEZHSnXE1MG/oWow9BHK1Pft0guBMO+KcF0Jd6vE0TdJ/PRljzy5/bOn xE4ThQHQFOw7g== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 06/33] rust: bump Clippy's MSRV and clean `incompatible_msrv` allows Date: Mon, 6 Apr 2026 01:52:42 +0200 Message-ID: <20260405235309.418950-7-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Following the Rust compiler bump, we can now update Clippy's MSRV we set in the configuration, which will improve the diagnostics it generates. Thus do so and clean a few of the `allow`s that are not needed anymore. Reviewed-by: Tamir Duberstein Acked-by: Danilo Krummrich Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- .clippy.toml | 2 +- drivers/gpu/nova-core/gsp/cmdq.rs | 6 +----- rust/kernel/ptr.rs | 1 - rust/kernel/transmute.rs | 2 -- 4 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.clippy.toml b/.clippy.toml index a51de9a46380..b0a78cc8be20 100644 --- a/.clippy.toml +++ b/.clippy.toml @@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 =20 -msrv =3D "1.78.0" +msrv =3D "1.85.0" =20 check-private-items =3D true =20 diff --git a/drivers/gpu/nova-core/gsp/cmdq.rs b/drivers/gpu/nova-core/gsp/= cmdq.rs index 46819a82a51a..d9f69366642a 100644 --- a/drivers/gpu/nova-core/gsp/cmdq.rs +++ b/drivers/gpu/nova-core/gsp/cmdq.rs @@ -281,7 +281,6 @@ fn allocate_command(&mut self, size: usize) -> Result> { let (slice_1, slice_2) =3D { let (slice_1, slice_2) =3D self.driver_write_area(); =20 - #[allow(clippy::incompatible_msrv)] (slice_1.as_flattened_mut(), slice_2.as_flattened_mut()) }; =20 @@ -572,10 +571,7 @@ fn wait_for_msg(&self, timeout: Delta) -> Result> { Delta::from_millis(1), timeout, ) - .map(|(slice_1, slice_2)| { - #[allow(clippy::incompatible_msrv)] - (slice_1.as_flattened(), slice_2.as_flattened()) - })?; + .map(|(slice_1, slice_2)| (slice_1.as_flattened(), slice_2.as_flat= tened()))?; =20 // Extract the `GspMsgElement`. let (header, slice_1) =3D GspMsgElement::from_bytes_prefix(slice_1= ).ok_or(EIO)?; diff --git a/rust/kernel/ptr.rs b/rust/kernel/ptr.rs index c7788656a162..91811f5e27de 100644 --- a/rust/kernel/ptr.rs +++ b/rust/kernel/ptr.rs @@ -81,7 +81,6 @@ pub const fn new_checked(align: usize) -> Option { /// This is equivalent to [`align_of`], but with the return value prov= ided as an [`Alignment`]. #[inline(always)] pub const fn of() -> Self { - #![allow(clippy::incompatible_msrv)] // This cannot panic since alignments are always powers of two. // // We unfortunately cannot use `new` as it would require the `gene= ric_const_exprs` feature. diff --git a/rust/kernel/transmute.rs b/rust/kernel/transmute.rs index 5711580c9f9b..b9e6eadc08f5 100644 --- a/rust/kernel/transmute.rs +++ b/rust/kernel/transmute.rs @@ -49,7 +49,6 @@ fn from_bytes(bytes: &[u8]) -> Option<&Self> let slice_ptr =3D bytes.as_ptr().cast::(); let size =3D size_of::(); =20 - #[allow(clippy::incompatible_msrv)] if bytes.len() =3D=3D size && slice_ptr.is_aligned() { // SAFETY: Size and alignment were just checked. unsafe { Some(&*slice_ptr) } @@ -92,7 +91,6 @@ fn from_bytes_mut(bytes: &mut [u8]) -> Option<&mut Self> let slice_ptr =3D bytes.as_mut_ptr().cast::(); let size =3D size_of::(); =20 - #[allow(clippy::incompatible_msrv)] if bytes.len() =3D=3D size && slice_ptr.is_aligned() { // SAFETY: Size and alignment were just checked. unsafe { Some(&mut *slice_ptr) } --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 364D9264A65; Sun, 5 Apr 2026 23:54:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433287; cv=none; b=LooFuI7d9woSLWyKKNs7ufkz1vBuQSeFsL1wvntMULv2W/T8gpy5fYVoLCcWeRo3/yatxd8zzP3s8chYYsUTR0NpYMhYCx4SxW+Su/yCtCFcEEtnDdbFGAgqVBNkCV67m1UFzg5dd1cM3tEVgYvzm8vMIm7qa6+MU3+T2Lp3k6Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433287; c=relaxed/simple; bh=kAA62WBPcurVVrTXPGLQy+IyDPvmVjelJYdVSSg7Y/E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R5tuv+LEtdC1wFdThuz5sWawECs3txehG9EPhumNhF0picrNaizKM17kZ2EYoJLR844vUPNjx2JxCZi4BgOwB/yhnXiesc7/GmpJAPBTgJaM3CswgovuUKpXPmxUDNIGqLdROzt0EHhwYW2WPW93dSC4BOtfH9zxy1HtUOT2H1U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CDWPhZSp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CDWPhZSp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 433ABC2BCB0; Sun, 5 Apr 2026 23:54:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433286; bh=kAA62WBPcurVVrTXPGLQy+IyDPvmVjelJYdVSSg7Y/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CDWPhZSpnW+m2srqW9KnMzV7G9L1iRvIsEo8KP7CScPqG1Ifub79N4yj4T0IKrXc0 4XmCbJ8zDasSdrjt7qHAlDp9GjyKU1PVePB9pLKwO1yYKuqMmE+zMzS3f8ObYOQMzG Sz8I1kSAf+/0TbbLJC2pKQ0kqL3IFyIPFzgAagHeEGUpcHcDj1c0A7xusZQz9bbfR1 FSgviWf3M31Ti8M4qq5aJadgtYloCGN8lrF7uyJTBqns8a/qMIIobVXaSkE/6gLioK tJwkSLx6bxzgYU0l/ny8XpR3fIxVt28+VUtoLh3KPsIh2WOCgv/Dnw0iO3ictk7CMV QrQTXJ8QympQw== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH v2 07/33] rust: allow globally `clippy::incompatible_msrv` Date: Mon, 6 Apr 2026 01:52:43 +0200 Message-ID: <20260405235309.418950-8-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" `clippy::incompatible_msrv` is not buying us much, and we discussed allowing it several times in the past. For instance, there was recently another patch sent to `allow` it where needed [1]. While that particular case would not be needed after the minimum version bump to 1.85.0, it is simpler to just allow it to prevent future instances. Thus do so, and remove the last instance of locally allowing it we have in the tree (except the one in the vendored `proc_macro2` crate). Note that we still keep the `msrv` config option in `clippy.toml` since that affects other lints as well. Link: https://lore.kernel.org/rust-for-linux/20260404212831.78971-4-jhubbar= d@nvidia.com/ [1] Signed-off-by: Miguel Ojeda Reviewed-by: Gary Guo Reviewed-by: Tamir Duberstein --- Makefile | 1 + rust/macros/helpers.rs | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a63684c36d60..78f5ee173eda 100644 --- a/Makefile +++ b/Makefile @@ -486,6 +486,7 @@ export rust_common_flags :=3D --edition=3D2021 \ -Wclippy::as_underscore \ -Wclippy::cast_lossless \ -Wclippy::ignored_unit_patterns \ + -Aclippy::incompatible_msrv \ -Wclippy::mut_mut \ -Wclippy::needless_bitwise_bool \ -Aclippy::needless_lifetimes \ diff --git a/rust/macros/helpers.rs b/rust/macros/helpers.rs index 37ef6a6f2c85..d18fbf4daa0a 100644 --- a/rust/macros/helpers.rs +++ b/rust/macros/helpers.rs @@ -49,7 +49,6 @@ pub(crate) fn file() -> String { } =20 #[cfg(CONFIG_RUSTC_HAS_SPAN_FILE)] - #[allow(clippy::incompatible_msrv)] { proc_macro::Span::call_site().file() } --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30E85342538; Sun, 5 Apr 2026 23:54:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433298; cv=none; b=ajcMwYp7ecb8KyQf5/idw1YFvZ+aOvo8NYOAqW+oe5E2YMEKT9AMLpFAZO7uFpLclXyaPbKkQ61se01PspVVGNHnuxT7hhDd/ooWRMJ4aQVjVNLrx56yLE2cw/z2duQOD0D6KumpcsPRx39TFO7/CkFQ1W99qQK09ZOVaykoe8A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433298; c=relaxed/simple; bh=zEAiIku4X7Y0hc7v9DxS7dQT5lhAUdf4bcfA9WafsEM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BxmdDFRWTOfrnQBRnX0NxNxzVW5n8r5QxuNJcrTwg07qHCjXMLK9eclauj4MG1i0zR9qWP3IzHshveOWQoSIxQWkexOBpMkBwnGqH0ZbUzGJRr2IRSObPgqJ18xOVCrNMoaUIZ42wdWpAXxgd156S2qNZ64f81k1wNevqIkTA9g= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KkarVOMv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KkarVOMv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36B6AC19425; Sun, 5 Apr 2026 23:54:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433297; bh=zEAiIku4X7Y0hc7v9DxS7dQT5lhAUdf4bcfA9WafsEM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KkarVOMv/eAWnbZswNfp2WIVyzZhZOaVT1moxhBROgr7XlggS7b9KhTq1UgpP++Zx Alotrr0bPvvYyo4kq6FyVc9YElH+P1TTlCs4ZJDoaQatZbjqXB+wmP3owqg14Of61w QgM2JYhZrkhdKFrFlvY2f4jGUHLEFksjOsoVEnBASEJqGV2AarC0Em5BCe5CzlS47S j5Wd5drcDjr9h3/HuN0p6YfhD8sEk6Y7iHcXTD8oeWf04xG4U8DAtYM0tEKntTSdCh MkAPdwq8G2+AFZ7GM7tcJHA678KuZN10hpC7WsUXu2VGc3XKFcIpwDOF2q8lXJJmsT bPpndWVVj+S2Q== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 08/33] rust: simplify `RUSTC_VERSION` Kconfig conditions Date: Mon, 6 Apr 2026 01:52:44 +0200 Message-ID: <20260405235309.418950-9-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" With the Rust version bump in place, several Kconfig conditions based on `RUSTC_VERSION` are always true. Thus simplify them. The minimum supported major LLVM version by our new Rust minimum version is now LLVM 18, instead of LLVM 16. However, there are no possible cleanups for `RUSTC_LLVM_VERSION`. Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- arch/Kconfig | 3 +-- arch/arm64/Kconfig | 8 -------- arch/riscv/Kconfig | 3 --- init/Kconfig | 2 -- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 102ddbd4298e..84089e80584b 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -968,10 +968,9 @@ config HAVE_CFI_ICALL_NORMALIZE_INTEGERS config HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC def_bool y depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS - depends on RUSTC_VERSION >=3D 107900 depends on ARM64 || X86_64 # With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pul= l/129373 - depends on (RUSTC_LLVM_VERSION >=3D 190103 && RUSTC_VERSION >=3D 108200) = || \ + depends on RUSTC_LLVM_VERSION >=3D 190103 || \ (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS) =20 config CFI_PERMISSIVE diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 38dba5f7e4d2..c91130c7fba1 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -291,14 +291,6 @@ config ARM64 config RUSTC_SUPPORTS_ARM64 def_bool y depends on CPU_LITTLE_ENDIAN - # Shadow call stack is only supported on certain rustc versions. - # - # When using the UNWIND_PATCH_PAC_INTO_SCS option, rustc version 1.80+ is - # required due to use of the -Zfixed-x18 flag. - # - # Otherwise, rustc version 1.82+ is required due to use of the - # -Zsanitizer=3Dshadow-call-stack flag. - depends on !SHADOW_CALL_STACK || RUSTC_VERSION >=3D 108200 || RUSTC_VERSI= ON >=3D 108000 && UNWIND_PATCH_PAC_INTO_SCS =20 config CLANG_SUPPORTS_DYNAMIC_FTRACE_WITH_ARGS def_bool CC_IS_CLANG diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 90c531e6abf5..ddc534402400 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -232,9 +232,6 @@ config RISCV config RUSTC_SUPPORTS_RISCV def_bool y depends on 64BIT - # Shadow call stack requires rustc version 1.82+ due to use of the - # -Zsanitizer=3Dshadow-call-stack flag. - depends on !SHADOW_CALL_STACK || RUSTC_VERSION >=3D 108200 =20 config CLANG_SUPPORTS_DYNAMIC_FTRACE def_bool CC_IS_CLANG diff --git a/init/Kconfig b/init/Kconfig index 36d32ea44594..b8a1ab0d49d4 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -2193,9 +2193,7 @@ config RUST depends on !DEBUG_INFO_BTF || (PAHOLE_HAS_LANG_EXCLUDE && !LTO) depends on !CFI || HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC select CFI_ICALL_NORMALIZE_INTEGERS if CFI - depends on !CALL_PADDING || RUSTC_VERSION >=3D 108100 depends on !KASAN_SW_TAGS - depends on !(MITIGATION_RETHUNK && KASAN) || RUSTC_VERSION >=3D 108300 help Enables Rust support in the kernel. =20 --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64055342538; Sun, 5 Apr 2026 23:55:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433309; cv=none; b=VbAMUnUdBnIds1YgOfm8A0/7N2Fx3AMwldSnI2+n8/XlC1KkkGuZels3u12qirV2cihewKYUUXIBSjF7fFW4Z1F1Hf3GGxuX95CPoQEWaZcF/7HitzvpeV187bXCn6bbAnAnj5coGkeJr6P2uC/FmCUIn+Wcyfx2jIV6KmHZzwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433309; c=relaxed/simple; bh=nKHljoFNdh6GE6jo8Il2V+4MwOz3gplkmJ7uy9RqO8E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C55b7I44Pj8zx30bl2lDxBzkhPbQxcFH4nFMdZl5MGzCl9ngtgW/Xm0OlrgORbGt9TWnl9mFV7TihYlDViPHGx904PEkeNDPWpaIeBNBFH0RKUOOUa5aIxHKUG52/N8HHx7jkuNSDvzZNp2JNOszR09lzTKng2HGd0AI+scdVmM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=C8O6kikO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="C8O6kikO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B924C116C6; Sun, 5 Apr 2026 23:54:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433309; bh=nKHljoFNdh6GE6jo8Il2V+4MwOz3gplkmJ7uy9RqO8E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=C8O6kikOLR/V/02C2dby6Y/oProcMBLuoWXI5fMzDgnA9/gNHDmG5OW3v12U4+ApI M7D5j3PQs8Qn+TqxBWio6NqZavJX48yjJQcSrZWhm8UkapxbQBbJSMLn6Rr4hL+BcU oBrMFthjMoPxGtYqz9gtVtvfzl1E29Z2GrDcd8+s/AFhsdXRbbFjVuYvp+FvDnANfA WiH9Ua8ujabe8zcqKO6Z20ebB8N4ELMduY+UjyCpId461mgHnIQFj2ULWzmdcI+jvd 2FtIsQzI1tFD6BdmI8fKDyTf0fLsclaDPgIVP/+AuFxyuGsxjKdhSm5o8sCv314tib yJ/keu9ic/DVg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 09/33] rust: remove `RUSTC_HAS_SLICE_AS_FLATTENED` and simplify code Date: Mon, 6 Apr 2026 01:52:45 +0200 Message-ID: <20260405235309.418950-10-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" With the Rust version bump in place, the `RUSTC_HAS_SLICE_AS_FLATTENED` Kconfig (automatic) option is always true. Thus remove the option and simplify the code. In particular, this includes removing the `slice` module which contained the temporary slice helpers, i.e. the `AsFlattened` extension trait and its `impl`s. Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- init/Kconfig | 3 --- rust/kernel/lib.rs | 1 - rust/kernel/prelude.rs | 3 --- rust/kernel/slice.rs | 49 ------------------------------------------ 4 files changed, 56 deletions(-) delete mode 100644 rust/kernel/slice.rs diff --git a/init/Kconfig b/init/Kconfig index b8a1ab0d49d4..c38f49228157 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -178,9 +178,6 @@ config LD_CAN_USE_KEEP_IN_OVERLAY # https://github.com/llvm/llvm-project/pull/130661 def_bool LD_IS_BFD || LLD_VERSION >=3D 210000 =20 -config RUSTC_HAS_SLICE_AS_FLATTENED - def_bool RUSTC_VERSION >=3D 108000 - config RUSTC_HAS_COERCE_POINTEE def_bool RUSTC_VERSION >=3D 108400 =20 diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index 138d846f798d..621cae75030c 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -140,7 +140,6 @@ pub mod security; pub mod seq_file; pub mod sizes; -pub mod slice; #[cfg(CONFIG_SOC_BUS)] pub mod soc; #[doc(hidden)] diff --git a/rust/kernel/prelude.rs b/rust/kernel/prelude.rs index e9d37f307f2a..44edf72a4a24 100644 --- a/rust/kernel/prelude.rs +++ b/rust/kernel/prelude.rs @@ -107,6 +107,3 @@ // `super::std_vendor` is hidden, which makes the macro inline for some re= ason. #[doc(no_inline)] pub use super::dbg; - -#[cfg(not(CONFIG_RUSTC_HAS_SLICE_AS_FLATTENED))] -pub use super::slice::AsFlattened; diff --git a/rust/kernel/slice.rs b/rust/kernel/slice.rs deleted file mode 100644 index ca2cde135061..000000000000 --- a/rust/kernel/slice.rs +++ /dev/null @@ -1,49 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -//! Additional (and temporary) slice helpers. - -/// Extension trait providing a portable version of [`as_flattened`] and -/// [`as_flattened_mut`]. -/// -/// In Rust 1.80, the previously unstable `slice::flatten` family of metho= ds -/// have been stabilized and renamed from `flatten` to `as_flattened`. -/// -/// This creates an issue for as long as the MSRV is < 1.80, as the same f= unctionality is provided -/// by different methods depending on the compiler version. -/// -/// This extension trait solves this by abstracting `as_flatten` and calli= ng the correct method -/// depending on the Rust version. -/// -/// This trait can be removed once the MSRV passes 1.80. -/// -/// [`as_flattened`]: https://doc.rust-lang.org/std/primitive.slice.html#m= ethod.as_flattened -/// [`as_flattened_mut`]: https://doc.rust-lang.org/std/primitive.slice.ht= ml#method.as_flattened_mut -#[cfg(not(CONFIG_RUSTC_HAS_SLICE_AS_FLATTENED))] -pub trait AsFlattened { - /// Takes a `&[[T; N]]` and flattens it to a `&[T]`. - /// - /// This is an portable layer on top of [`as_flattened`]; see its docu= mentation for details. - /// - /// [`as_flattened`]: https://doc.rust-lang.org/std/primitive.slice.ht= ml#method.as_flattened - fn as_flattened(&self) -> &[T]; - - /// Takes a `&mut [[T; N]]` and flattens it to a `&mut [T]`. - /// - /// This is an portable layer on top of [`as_flattened_mut`]; see its = documentation for details. - /// - /// [`as_flattened_mut`]: https://doc.rust-lang.org/std/primitive.slic= e.html#method.as_flattened_mut - fn as_flattened_mut(&mut self) -> &mut [T]; -} - -#[cfg(not(CONFIG_RUSTC_HAS_SLICE_AS_FLATTENED))] -impl AsFlattened for [[T; N]] { - #[allow(clippy::incompatible_msrv)] - fn as_flattened(&self) -> &[T] { - self.flatten() - } - - #[allow(clippy::incompatible_msrv)] - fn as_flattened_mut(&mut self) -> &mut [T] { - self.flatten_mut() - } -} --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CFA0342538; Sun, 5 Apr 2026 23:55:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433320; cv=none; b=JVnCsahv6u8p2NwXiH+0r8qz1xvy+blHpweoCTQXyvp3AIHtkZ/ZudfB/Y5UhC8Hqx9/qCNg1MsvT/Uty6EoaV1NoFY2JuT3mNgB5E33LPolLJZZMCp1oPFUZ3rhDgql1rYW2CQeJzD83tyrlr/P3um/yrR+5c82I0pjLDww5Tk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433320; c=relaxed/simple; bh=HV0bL0gHeo5ytVraoqeUk7gpt273iWarFnhuW3AZrCI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AGVSdhZu8wiYQDR29s5VHl/V5PP14q2RAhwRTCCut+otnGA4FN5tqfeoN0lf0nLOulYWWvM6MMWaBPcYCswKrFs0g5rFon43PhYlsjpXYy+0wCz+hWJZoCkjra0yL8S+wSs67HRcgk+DQDa6fpZppVCgv2rCK+C0TIZrzARYstI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gCHzAlM6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gCHzAlM6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86601C116C6; Sun, 5 Apr 2026 23:55:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433320; bh=HV0bL0gHeo5ytVraoqeUk7gpt273iWarFnhuW3AZrCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gCHzAlM6VUIfeMuR3tiYiw4x52ObAlTAx9UnTip4jjUZVJ+sCfoUGSFvE9wPi7740 3QRK9w03A1z3Tiq5yMZhcKxEuaP5+x1h4JJYclMBu42+WH1zGRYSSJnyRXj0xz8xrv WlxPczxRkcp0lLRcjK9sorp63+5xChEEuulrugfJ6ET5VVvThzAtNxIfG4WG00VknT VdwbEkh/mOhhQJFQ0CiDoVyIB6OAVfcFk5XDu9QYRf/aMi7Zgkc5If449omeQ0BNT3 YtPI2fbmIXg2yzp3nTj1jj9b4E2kcYl6f6NENEgnXH14mkqjTi3gSF9ScvSlzg3pmV OfGyMkO6NzpJQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 10/33] rust: remove `RUSTC_HAS_COERCE_POINTEE` and simplify code Date: Mon, 6 Apr 2026 01:52:46 +0200 Message-ID: <20260405235309.418950-11-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" With the Rust version bump in place, the `RUSTC_HAS_COERCE_POINTEE` Kconfig (automatic) option is always true. Thus remove the option and simplify the code. In particular, this includes removing our use of the predecessor unstable features we used with Rust < 1.84.0 (`coerce_unsized`, `dispatch_from_dyn` and `unsize`). Reviewed-by: Tamir Duberstein Acked-by: Danilo Krummrich Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- init/Kconfig | 3 --- rust/kernel/alloc/kbox.rs | 29 ++--------------------------- rust/kernel/lib.rs | 8 +------- rust/kernel/list/arc.rs | 22 +--------------------- rust/kernel/sync/arc.rs | 21 ++------------------- 5 files changed, 6 insertions(+), 77 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index c38f49228157..f9fac458e4d4 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -178,9 +178,6 @@ config LD_CAN_USE_KEEP_IN_OVERLAY # https://github.com/llvm/llvm-project/pull/130661 def_bool LD_IS_BFD || LLD_VERSION >=3D 210000 =20 -config RUSTC_HAS_COERCE_POINTEE - def_bool RUSTC_VERSION >=3D 108400 - config RUSTC_HAS_SPAN_FILE def_bool RUSTC_VERSION >=3D 108800 =20 diff --git a/rust/kernel/alloc/kbox.rs b/rust/kernel/alloc/kbox.rs index 622b3529edfc..bd6da02c7ab8 100644 --- a/rust/kernel/alloc/kbox.rs +++ b/rust/kernel/alloc/kbox.rs @@ -77,33 +77,8 @@ /// `self.0` is always properly aligned and either points to memory alloca= ted with `A` or, for /// zero-sized types, is a dangling, well aligned pointer. #[repr(transparent)] -#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, derive(core::marker::CoercePoi= ntee))] -pub struct Box<#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, pointee)] T: ?S= ized, A: Allocator>( - NonNull, - PhantomData, -); - -// This is to allow coercion from `Box` to `Box` if `T` can be= converted to the -// dynamically-sized type (DST) `U`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl core::ops::CoerceUnsized> for Box -where - T: ?Sized + core::marker::Unsize, - U: ?Sized, - A: Allocator, -{ -} - -// This is to allow `Box` to be dispatched on when `Box` can b= e coerced into `Box`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl core::ops::DispatchFromDyn> for Box -where - T: ?Sized + core::marker::Unsize, - U: ?Sized, - A: Allocator, -{ -} +#[derive(core::marker::CoercePointee)] +pub struct Box<#[pointee] T: ?Sized, A: Allocator>(NonNull, PhantomData= ); =20 /// Type alias for [`Box`] with a [`Kmalloc`] allocator. /// diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index 621cae75030c..66a09d77a2c4 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -39,17 +39,11 @@ // // Expected to become stable. #![feature(arbitrary_self_types)] +#![feature(derive_coerce_pointee)] // // To be determined. #![feature(used_with_arg)] // -// `feature(derive_coerce_pointee)` is expected to become stable. Before R= ust -// 1.84.0, it did not exist, so enable the predecessor features. -#![cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, feature(derive_coerce_pointee= ))] -#![cfg_attr(not(CONFIG_RUSTC_HAS_COERCE_POINTEE), feature(coerce_unsized))] -#![cfg_attr(not(CONFIG_RUSTC_HAS_COERCE_POINTEE), feature(dispatch_from_dy= n))] -#![cfg_attr(not(CONFIG_RUSTC_HAS_COERCE_POINTEE), feature(unsize))] -// // `feature(file_with_nul)` is expected to become stable. Before Rust 1.89= .0, it did not exist, so // enable it conditionally. #![cfg_attr(CONFIG_RUSTC_HAS_FILE_WITH_NUL, feature(file_with_nul))] diff --git a/rust/kernel/list/arc.rs b/rust/kernel/list/arc.rs index e1082423909c..a9a2b0178f65 100644 --- a/rust/kernel/list/arc.rs +++ b/rust/kernel/list/arc.rs @@ -160,7 +160,7 @@ fn try_new_list_arc(&self) -> bool { /// /// [`List`]: crate::list::List #[repr(transparent)] -#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, derive(core::marker::CoercePoi= ntee))] +#[derive(core::marker::CoercePointee)] pub struct ListArc where T: ListArcSafe + ?Sized, @@ -443,26 +443,6 @@ fn as_ref(&self) -> &Arc { } } =20 -// This is to allow coercion from `ListArc` to `ListArc` if `T` can = be converted to the -// dynamically-sized type (DST) `U`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl core::ops::CoerceUnsized> for Lis= tArc -where - T: ListArcSafe + core::marker::Unsize + ?Sized, - U: ListArcSafe + ?Sized, -{ -} - -// This is to allow `ListArc` to be dispatched on when `ListArc` can= be coerced into -// `ListArc`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl core::ops::DispatchFromDyn> for L= istArc -where - T: ListArcSafe + core::marker::Unsize + ?Sized, - U: ListArcSafe + ?Sized, -{ -} - /// A utility for tracking whether a [`ListArc`] exists using an atomic. /// /// # Invariants diff --git a/rust/kernel/sync/arc.rs b/rust/kernel/sync/arc.rs index 921e19333b89..18d6c0d62ce0 100644 --- a/rust/kernel/sync/arc.rs +++ b/rust/kernel/sync/arc.rs @@ -128,7 +128,7 @@ /// # Ok::<(), Error>(()) /// ``` #[repr(transparent)] -#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, derive(core::marker::CoercePoi= ntee))] +#[derive(core::marker::CoercePointee)] pub struct Arc { ptr: NonNull>, // NB: this informs dropck that objects of type `ArcInner` may be u= sed in ` as @@ -182,15 +182,6 @@ unsafe fn container_of(ptr: *const T) -> NonNull> { } } =20 -// This is to allow coercion from `Arc` to `Arc` if `T` can be conve= rted to the -// dynamically-sized type (DST) `U`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl, U: ?Sized> core::ops::CoerceUnsi= zed> for Arc {} - -// This is to allow `Arc` to be dispatched on when `Arc` can be coer= ced into `Arc`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl, U: ?Sized> core::ops::DispatchFr= omDyn> for Arc {} - // SAFETY: It is safe to send `Arc` to another thread when the underlyi= ng `T` is `Sync` because // it effectively means sharing `&T` (which is safe because `T` is `Sync`)= ; additionally, it needs // `T` to be `Send` because any thread that has an `Arc` may ultimately= access `T` using a @@ -547,20 +538,12 @@ fn from(item: Pin>) -> Self { /// # Ok::<(), Error>(()) /// ``` #[repr(transparent)] -#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, derive(core::marker::CoercePoi= ntee))] +#[derive(core::marker::CoercePointee)] pub struct ArcBorrow<'a, T: ?Sized + 'a> { inner: NonNull>, _p: PhantomData<&'a ()>, } =20 -// This is to allow `ArcBorrow` to be dispatched on when `ArcBorrow`= can be coerced into -// `ArcBorrow`. -#[cfg(not(CONFIG_RUSTC_HAS_COERCE_POINTEE))] -impl, U: ?Sized> core::ops::DispatchFr= omDyn> - for ArcBorrow<'_, T> -{ -} - impl Clone for ArcBorrow<'_, T> { fn clone(&self) -> Self { *self --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A795B3845CB; Sun, 5 Apr 2026 23:55:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433331; cv=none; b=r1uYyzux0VLdKyZo1XnwNcFiArcb2quHNw4/KJvqj9mTA/fD2d5Ir3DzsVBLb5bV0lc8qvhPWUelV9X/n9AcpE0RGjRtHpuPpAwquT3AVPUDR7nME670pDY6c3kXjoBYtzhXCOfWFsdbim4fx2EZR634Whxb52kiCScBsF2T3bk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433331; c=relaxed/simple; bh=y9tHNT9LLwvCnIp2g8KfzIzoqrv/gM7tQZbqTUN0GxU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=URuckKw5wV9u8gUxH76Kq+65Zax9e4E96EXF9g8CwvkUFcazXKqfcZMnPIehrlPuRE8ZM5Tgl6dmTkIQVIVWs3Cc6qhRlktfDoV4ggK1FnMd9xSPmBy29Q3chP8e7rdFR5NudURbpDMOtgTawnoWnOUIqIqP/yCNZFSpBm5Z1W8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=PWyM8OyK; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PWyM8OyK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD4E1C2BCB0; Sun, 5 Apr 2026 23:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433331; bh=y9tHNT9LLwvCnIp2g8KfzIzoqrv/gM7tQZbqTUN0GxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PWyM8OyKxUz2TNjL8+e0G5SaNub5kKLoxTD9YqzS8KN12eDUh3ZxxS1ZwAzbPmbfi nDroB+Dw6RlYMaIL1hnynDku4rObXrjTriUfRg/LjdBlpJ5OogQ+hXxDqZ5iAO3GAK e23RwquOxN6ersxOC2v4Ca/qVybz5FXHmP0vq4U7f/+JsRHgs3qrHbTqzV1ypTAys0 UfpfwtLB8OR4qY8z6MRfaqIIuEmSd/QnTRo3ZGXmJFgkIE5hy3PpAGlENeQma7W6Kh TbGlWD7OxbQ+ffRD4Uktwmuh8O2wehF4rKRblvXpaWPq7wb8e0PQQD7ybIk0+Jhh7V ALQrawJ7O1w1A== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 11/33] rust: kbuild: remove skipping of `-Wrustdoc::unescaped_backticks` Date: Mon, 6 Apr 2026 01:52:47 +0200 Message-ID: <20260405235309.418950-12-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Back in Rust 1.82.0, I cleaned the `rustdoc::unescaped_backticks` lint in upstream Rust and added tests so that hopefully it would not regress [1]. Thus we can remove it from our side given the Rust minimum version bump. Link: https://github.com/rust-lang/rust/pull/128307 [1] Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- rust/Makefile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/rust/Makefile b/rust/Makefile index 16ea720e0a8e..5dc8b4cc89d1 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -75,8 +75,7 @@ core-edition :=3D $(if $(call rustc-min-version,108700),2= 024,2021) =20 core-skip_flags :=3D \ --edition=3D2021 \ - -Wunreachable_pub \ - -Wrustdoc::unescaped_backticks + -Wunreachable_pub =20 core-flags :=3D \ --edition=3D$(core-edition) \ @@ -209,8 +208,6 @@ rustdoc-macros: $(src)/macros/lib.rs rustdoc-clean rust= doc-proc_macro2 \ rustdoc-quote rustdoc-syn FORCE +$(call if_changed,rustdoc) =20 -# Starting with Rust 1.82.0, skipping `-Wrustdoc::unescaped_backticks` sho= uld -# not be needed -- see https://github.com/rust-lang/rust/pull/128307. rustdoc-core: private skip_flags =3D $(core-skip_flags) rustdoc-core: private rustc_target_flags =3D $(core-flags) rustdoc-core: $(RUST_LIB_SRC)/core/src/lib.rs rustdoc-clean FORCE --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBBEA264A65; Sun, 5 Apr 2026 23:55:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433343; cv=none; b=BLKu+t13uTEys+8nzMIjzI66/jSz5qNUFZG402dxTBid+mHxt+U3M3gVToP0SgVNOJOQF0ovPAVRTN+9D6mrq35IzTRvjbI2XtqVwKnuYJnH5PXDkQZ71entVUvmbxvj4ixtyneKQxc2ezw0Q12jhCxigKcaN2hxfm1Iyo5aVP8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433343; c=relaxed/simple; bh=rhX3GqYQx8Jl+4tNpW2dKwQfeZlDw97dCDSWyN1kX4M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FvP8n/BDZmDPHGEmXrqFwW/wTYZ0YtcLdTyjBvTdd3uBv1W7BNA5ugiNvYFDJnWP7hmc+N/NN+h+7p4a2GlfAwfcPaNeaO60sFSYu9Z9zB54PB8jt8ng7b5rcvBiZ5F2YAAX+/jwhB701ngSRGYSNbRhSyXiSgf2D8ejP0R058w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k9uNPKIn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k9uNPKIn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2C13C19425; Sun, 5 Apr 2026 23:55:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433342; bh=rhX3GqYQx8Jl+4tNpW2dKwQfeZlDw97dCDSWyN1kX4M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k9uNPKIn7BIlbZBmyZCrn8YA4s8vt211ZS4DryUsRUPtxc5Ce8n1gRoz4IJwAZAOM Dqp6WAkHoyNQ5zLX/rFldY3wmp5C0ZX9hMiMmyPCl23fRGYclj6I0liqouATnE4LD5 pcFG9FLiF8HJvJFDEPMbFqVuOs1Sev37pt+zIjJGlujkwagUUjAkqve/cRsglEd1ZT YiS3IliuGDO6QuzIfUhTNpdbpp9ewjzWfepATKG30fXTF2uazRnxese4dQeQwSvagT fgaN2tp5c1O58eBWINvTswa4V0NA7jTUtPANRuwj1H8I0rNnXGdb+lFXnGYIzYtfvK caK/MHh2zv9WQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 12/33] rust: kbuild: remove `feature(...)`s that are now stable Date: Mon, 6 Apr 2026 01:52:48 +0200 Message-ID: <20260405235309.418950-13-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Now that the Rust minimum version is 1.85.0, there is no need to enable certain features that are stable. Thus clean them up. Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- rust/Makefile | 2 -- rust/kernel/lib.rs | 21 --------------------- scripts/Makefile.build | 6 +----- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/rust/Makefile b/rust/Makefile index 5dc8b4cc89d1..54498cb5b851 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -86,10 +86,8 @@ proc_macro2-cfgs :=3D \ wrap_proc_macro \ $(if $(call rustc-min-version,108800),proc_macro_span_file proc_macro_= span_location) =20 -# Stable since Rust 1.79.0: `feature(proc_macro_byte_character,proc_macro_= c_str_literals)`. proc_macro2-flags :=3D \ --cap-lints=3Dallow \ - -Zcrate-attr=3D'feature(proc_macro_byte_character,proc_macro_c_str_lit= erals)' \ $(call cfgs-to-flags,$(proc_macro2-cfgs)) =20 quote-cfgs :=3D \ diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs index 66a09d77a2c4..b48221a5b4ec 100644 --- a/rust/kernel/lib.rs +++ b/rust/kernel/lib.rs @@ -16,27 +16,6 @@ // Please see https://github.com/Rust-for-Linux/linux/issues/2 for details= on // the unstable features in use. // -// Stable since Rust 1.79.0. -#![feature(generic_nonzero)] -#![feature(inline_const)] -#![feature(pointer_is_aligned)] -// -// Stable since Rust 1.80.0. -#![feature(slice_flatten)] -// -// Stable since Rust 1.81.0. -#![feature(lint_reasons)] -// -// Stable since Rust 1.82.0. -#![feature(raw_ref_op)] -// -// Stable since Rust 1.83.0. -#![feature(const_maybe_uninit_as_mut_ptr)] -#![feature(const_mut_refs)] -#![feature(const_option)] -#![feature(const_ptr_write)] -#![feature(const_refs_to_cell)] -// // Expected to become stable. #![feature(arbitrary_self_types)] #![feature(derive_coerce_pointee)] diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 0b0245106d01..57cff77c2897 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -310,17 +310,13 @@ $(obj)/%.lst: $(obj)/%.c FORCE =20 # The features in this list are the ones allowed for non-`rust/` code. # -# - Stable since Rust 1.79.0: `feature(inline_const)`. -# - Stable since Rust 1.81.0: `feature(lint_reasons)`. -# - Stable since Rust 1.82.0: `feature(asm_const)`, -# `feature(offset_of_nested)`, `feature(raw_ref_op)`. # - Stable since Rust 1.87.0: `feature(asm_goto)`. # - Expected to become stable: `feature(arbitrary_self_types)`. # - To be determined: `feature(used_with_arg)`. # # Please see https://github.com/Rust-for-Linux/linux/issues/2 for details = on # the unstable features in use. -rust_allowed_features :=3D asm_const,asm_goto,arbitrary_self_types,inline_= const,lint_reasons,offset_of_nested,raw_ref_op,used_with_arg +rust_allowed_features :=3D arbitrary_self_types,asm_goto,used_with_arg =20 # `--out-dir` is required to avoid temporaries being created by `rustc` in= the # current working directory, which may be not accessible in the out-of-tree --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC41A38425C; Sun, 5 Apr 2026 23:55:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433353; cv=none; b=Egsr0+zXBckBvZoXri5UQFKOjQudcQWyha4n2Js1xowcaEgEtL6/o99Aa+2NNdifGiX0iqM55ex/Hw9SNfGd+RDT4A9HRqkns6yU2JlKHvR2M3gTeP4Ap2pFqgiYPzfTQWDnAEafSiq64DorsOiuC4vGkfphHC21pM9zRCNYcN0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433353; c=relaxed/simple; bh=5w/hrnObbKhvO+jKV9Ekcn8KO5lrvAgEuh7kkEvfcjs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DWdwx4FlNJfJWoLn6u1R5zoctzbsSlIjxxaWyYnQNAoJTCrKt/hNB5EWEQrUmCivZAa7Iolc1eavK0vpNSzeMsW5tMyk04GWyNi201s7p+8gUAsTOIkdzLs1ojT/x/pfV6G9wJyg5Fz2pAHfo3q9NrthQPeZD+lF3wsOz8aopt4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pFKlWdbI; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pFKlWdbI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 03DC7C116C6; Sun, 5 Apr 2026 23:55:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433353; bh=5w/hrnObbKhvO+jKV9Ekcn8KO5lrvAgEuh7kkEvfcjs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pFKlWdbIbGq0s7ECR/XX4/m1j5ueBsd37sKXJ5uePknRDz52bcxRKKdQUe1jTopVz My33xj+WU7MHbje6Gh0L7CxJ3KxzvwAzOCWOcACpPEKqFS6mcKRf8vZJADvLXmZb8Y o52+2gns0KIFCn54pt8VBrZ+FWo9rC1to0WiGTYC13dYbxzXvTcpelifn0bJwujKk8 86EYB1I8NJU19juZwmDdg9wxjSeTqxQvMdO4C+IKLVR+fihXZU6p1+0tn/pIcBpd8O l9nnLvpiSxsgD13f15cAIkVKNBh1pZpZ73szNIqI8iXIz7LHd1T89xgFnRcsHNKyFY 9vVjtBOKjhKqQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 13/33] rust: transmute: simplify code with Rust 1.80.0 `split_at_*checked()` Date: Mon, 6 Apr 2026 01:52:49 +0200 Message-ID: <20260405235309.418950-14-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" `feature(split_at_checked)` [1] has been stabilized in Rust 1.80.0 [2], which is older than our new minimum Rust version (Rust 1.85.0). Thus simplify the code using `split_at_*checked()`. Link: https://github.com/rust-lang/rust/issues/119128 [1] Link: https://github.com/rust-lang/rust/pull/124678 [2] Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- rust/kernel/transmute.rs | 33 ++++++--------------------------- 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/rust/kernel/transmute.rs b/rust/kernel/transmute.rs index b9e6eadc08f5..654b5ede2fe2 100644 --- a/rust/kernel/transmute.rs +++ b/rust/kernel/transmute.rs @@ -66,16 +66,9 @@ fn from_bytes_prefix(bytes: &[u8]) -> Option<(&Self, &[u= 8])> where Self: Sized, { - if bytes.len() < size_of::() { - None - } else { - // PANIC: We checked that `bytes.len() >=3D size_of::`, = thus `split_at` cannot - // panic. - // TODO: replace with `split_at_checked` once the MSRV is >=3D= 1.80. - let (prefix, remainder) =3D bytes.split_at(size_of::()); + let (prefix, remainder) =3D bytes.split_at_checked(size_of::= ())?; =20 - Self::from_bytes(prefix).map(|s| (s, remainder)) - } + Self::from_bytes(prefix).map(|s| (s, remainder)) } =20 /// Converts a mutable slice of bytes to a reference to `Self`. @@ -108,16 +101,9 @@ fn from_bytes_mut_prefix(bytes: &mut [u8]) -> Option<(= &mut Self, &mut [u8])> where Self: AsBytes + Sized, { - if bytes.len() < size_of::() { - None - } else { - // PANIC: We checked that `bytes.len() >=3D size_of::`, = thus `split_at_mut` cannot - // panic. - // TODO: replace with `split_at_mut_checked` once the MSRV is = >=3D 1.80. - let (prefix, remainder) =3D bytes.split_at_mut(size_of::= ()); + let (prefix, remainder) =3D bytes.split_at_mut_checked(size_of::())?; =20 - Self::from_bytes_mut(prefix).map(|s| (s, remainder)) - } + Self::from_bytes_mut(prefix).map(|s| (s, remainder)) } =20 /// Creates an owned instance of `Self` by copying `bytes`. @@ -147,16 +133,9 @@ fn from_bytes_copy_prefix(bytes: &[u8]) -> Option<(Sel= f, &[u8])> where Self: Sized, { - if bytes.len() < size_of::() { - None - } else { - // PANIC: We checked that `bytes.len() >=3D size_of::`, = thus `split_at` cannot - // panic. - // TODO: replace with `split_at_checked` once the MSRV is >=3D= 1.80. - let (prefix, remainder) =3D bytes.split_at(size_of::()); + let (prefix, remainder) =3D bytes.split_at_checked(size_of::= ())?; =20 - Self::from_bytes_copy(prefix).map(|s| (s, remainder)) - } + Self::from_bytes_copy(prefix).map(|s| (s, remainder)) } } =20 --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5B657382365; Sun, 5 Apr 2026 23:56:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433365; cv=none; b=BS69aHOtdM1R0wS4Pn12HvEsAcFPBjIhBqW1+BhtShuWgT/1YpG728z5G1r76rPFiFkxbUVSCj846qC0ete3l4OU/qutBjQZSEodLKJ5p3Gtn3gIm3P7j5BgmSPvFS5JgfwGtp6lCmRv4Ed2hO2RmZi8f52o5thMPD8TUKw5nrY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433365; c=relaxed/simple; bh=H/Ay6Jkav43FJVWalNMqy1drrqBC5z0jZaYEliYSxsg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AW1YSnm3q1+/OCYF6B94Ubuv+r+thOtFlkNo56zqy9tkB+jX/AOaBszGKQI2rDXrJuwMNs/Ieo2Bxnl1hoL+ExB+EuogyFk6teBohpaznjpm71HqZ/vORQrPMcujIUZgueP9DdBOuw23mEjMswPZrsPoIJEMG2/hKLIXvp7uS3U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QWwho++C; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QWwho++C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 27803C2BC9E; Sun, 5 Apr 2026 23:55:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433364; bh=H/Ay6Jkav43FJVWalNMqy1drrqBC5z0jZaYEliYSxsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QWwho++CAQHqbiJSHYjIFW+3zbIRsYkzI2NhaXD915XErZ5bX8D0JSqumwCvnboQC JA2kZyy0PbupBQQ6NzUS0I5RoleMORu4/mJ8QJHPf8WuIxsJK2BntYwSEFYuKrHgs5 VPKZomQQHZR70NsihUxiVAScWTSo2yfHf8uJ/qsMQd0mTZH9HvJHft2Dn5JgiAXnIO 3PdrXjw1Cnt6FYPbyK/FBO1nONRhPiI30ad4Kc7dhk4L7g63i4MoWAU0uWhs56aoAB o0/TRdl5mjZSVEIann5jDzC12StU6bGXcn2XxNGHneIkfSLv34y3M6cbP04LdQktPx m2gUzuUeHkCMQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 14/33] rust: alloc: simplify with `NonNull::add()` now that it is stable Date: Mon, 6 Apr 2026 01:52:50 +0200 Message-ID: <20260405235309.418950-15-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Currently, we need to go through raw pointers and then re-create the `NonNull` from the result of offsetting the raw pointer. `feature(non_null_convenience)` [1] has been stabilized in Rust 1.80.0 [2], which is older than our new minimum Rust version (Rust 1.85.0). Thus, now that we bump the Rust minimum version, simplify using `NonNull::add()` and clean the TODO note. Link: https://github.com/rust-lang/rust/issues/117691 [1] Link: https://github.com/rust-lang/rust/pull/124498 [2] Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Acked-by: Danilo Krummrich Signed-off-by: Miguel Ojeda --- rust/kernel/alloc/allocator/iter.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/rust/kernel/alloc/allocator/iter.rs b/rust/kernel/alloc/alloca= tor/iter.rs index 5759f86029b7..e0a70b7a744a 100644 --- a/rust/kernel/alloc/allocator/iter.rs +++ b/rust/kernel/alloc/allocator/iter.rs @@ -42,15 +42,9 @@ fn next(&mut self) -> Option { return None; } =20 - // TODO: Use `NonNull::add()` instead, once the minimum supported = compiler version is - // bumped to 1.80 or later. - // // SAFETY: `offset` is in the interval `[0, (self.page_count() - 1= ) * page::PAGE_SIZE]`, // hence the resulting pointer is guaranteed to be within the same= allocation. - let ptr =3D unsafe { self.buf.as_ptr().add(offset) }; - - // SAFETY: `ptr` is guaranteed to be non-null given that it is der= ived from `self.buf`. - let ptr =3D unsafe { NonNull::new_unchecked(ptr) }; + let ptr =3D unsafe { self.buf.add(offset) }; =20 // SAFETY: // - `ptr` is a valid pointer to a `Vmalloc` allocation. --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E192D3845CB; Sun, 5 Apr 2026 23:56:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433376; cv=none; b=RBSP8U2ZprePrnNZd+2v78ETDcN3BANo8CWEzczLMW/d8wCnGAiKZUVb8DCgbOeQspEOT3Ow1pNbK0hsKylMGZ5+7kdMJVkS6qK83+wgA3TnU0ic+joMX3eFZJfF0gBiJyd7ZS3u9dzNnbYTBblS2w7MjyMKH7XyV0DyNZhgmuw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433376; c=relaxed/simple; bh=k9fgvKqzt3CcMjpByOnUKIVw60bYTXCQ8WCT/cyECdY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BUDMTq70p4g4mrTh870XnKUcJpW02pVW3vCEYUSWtPXNwW5s+mPteGAF2XxgyU+AOR24el5FmueqXl215VEIEpruxvBe66mQ3+PyDK2I3AvewOJ8fqbmXrVSLBPpd8is473hzOgeMf8eL5NCp/KyGrK1WtVEfPqvYpJeKuExI14= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZaVpVUGO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZaVpVUGO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AA99C116C6; Sun, 5 Apr 2026 23:56:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433375; bh=k9fgvKqzt3CcMjpByOnUKIVw60bYTXCQ8WCT/cyECdY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZaVpVUGO29xolVVSHHDaY6zc64XoWTVURD4wmowEYx41c+Wyvxg2ZvbRUDBr5NSQM qnQ7znq5xPGmdnTPdcYVaZC7vnG5CdMVAK8esq+ZQUqP5fhEE9eEYKap4bE1TE6jn4 tBmF/lQcMvqLIbmPK7hFkihBrJN3xVu01fVsz+MN4SzEjt8l16fIDNn69GQncl9Yl+ Iz0ORhzjuBLkOlJxT/Q92ItzFvNRq1IEAlPAFGwQoUdailI/ja4qppsGHHJ+cazKlw zeuH4jXdUNlzyLPBG4DfcSUb8nvgueaNnyXHPAthjZQRgSoxFxQLDP6Ba6EFq9edcZ rD1Bo7j0WdTjg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH v2 15/33] rust: macros: simplify code using `feature(extract_if)` Date: Mon, 6 Apr 2026 01:52:51 +0200 Message-ID: <20260405235309.418950-16-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" `feature(extract_if)` [1] was stabilized in Rust 1.87.0 [2], and the last significant change happened in Rust 1.85.0 [3] when the range parameter was added. That is, with our new minimum version, we can start using the feature. Thus simplify the code using the feature and remove the TODO comment. Suggested-by: Gary Guo Link: https://lore.kernel.org/rust-for-linux/DHHVSX66206Y.3E7I9QUNTCJ8I@gar= yguo.net/ Link: https://github.com/rust-lang/rust/issues/43244 [1] Link: https://github.com/rust-lang/rust/pull/137109 [2] Link: https://github.com/rust-lang/rust/pull/133265 [3] Signed-off-by: Miguel Ojeda Reviewed-by: Tamir Duberstein --- rust/macros/kunit.rs | 9 +++++---- rust/macros/lib.rs | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/rust/macros/kunit.rs b/rust/macros/kunit.rs index 6be880d634e2..ae20ed6768f1 100644 --- a/rust/macros/kunit.rs +++ b/rust/macros/kunit.rs @@ -87,10 +87,11 @@ pub(crate) fn kunit_tests(test_suite: Ident, mut module= : ItemMod) -> Result=3D 1.88.0. --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 34E94264A65; Sun, 5 Apr 2026 23:56:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433387; cv=none; b=OdLaFsntKJ+oAvxqWUPlgPOdoxjpns4Or2uUc0FnFKQ72nmZdI3h7AtjcdZDPpve46Ybg5Mzy7hE5Ab69HO33/Oy4GZs+iCvkUltF2RVce72kyU7kl7ymsRZcMCyu3Q+n48ZwL/JL6KHynXqc37v8h3aSqKeB42uISMm0OY0T8c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433387; c=relaxed/simple; bh=epQs3AsyxZ8hhy5ISUPTkOTvgvbeYkZEdG041MVzF80=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VScC9PULCUJ/wtkwKdPpjcZwo2j20IG7FTcXhDiT7KV0tkrEciIZc8UOr1M55jxcQ+NC4gQwgSsq7W0Qf4MOzbVspHj/wn4d249hkw97RsDZlrIO1UUnikBb91NE3R74PL2M5sI93xW5KxPfeWH+top5EI8SZSLKGbVTXdqMSsE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=D5Jq/KNe; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="D5Jq/KNe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4322DC2BC9E; Sun, 5 Apr 2026 23:56:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433386; bh=epQs3AsyxZ8hhy5ISUPTkOTvgvbeYkZEdG041MVzF80=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D5Jq/KNe79Oh6OGcaoN5PmN2FFcrPk6GXdZcnPkCCDQp2UqHYQ9SjPNHV1332T+nF T+EMIfEl65JCvssoBOyMtZZKNAxU8TmRe5HaKPPwK+gBHmI/vYuqdH1BJv358cKnCs j84VKway/sOwJ1457dvilIKK/J+Q/OQaHKwpmKO95nCh4B7yrwTBxi9e0NrjaZTtt9 crDuyneI/9sBvcynswhVdLKgIKdEhefPzcWdNZgBm/jAYpMGU+0smar730LDYpqwvX AJij9W0+y1c22mbCnukDGTJao+rlNiw93Km7Z7OnP8ZZkoqeUHZ03Xxf7FbRHImwOl bXVw24EbqtJYQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 16/33] rust: block: update `const_refs_to_static` MSRV TODO comment Date: Mon, 6 Apr 2026 01:52:52 +0200 Message-ID: <20260405235309.418950-17-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" `feature(const_refs_to_static)` was stabilized in Rust 1.83.0 [1]. Thus update the comment to reflect that. Link: https://github.com/rust-lang/rust/pull/129759 [1] Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- rust/kernel/block/mq/gen_disk.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/rust/kernel/block/mq/gen_disk.rs b/rust/kernel/block/mq/gen_di= sk.rs index c8b0ecb17082..912cb805caf5 100644 --- a/rust/kernel/block/mq/gen_disk.rs +++ b/rust/kernel/block/mq/gen_disk.rs @@ -140,9 +140,7 @@ pub fn build( devnode: None, alternative_gpt_sector: None, get_unique_id: None, - // TODO: Set to THIS_MODULE. Waiting for const_refs_to_static = feature to - // be merged (unstable in rustc 1.78 which is staged for linux= 6.10) - // + // TODO: Set to `THIS_MODULE`. owner: core::ptr::null_mut(), pr_ops: core::ptr::null_mut(), free_disk: None, --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6A73A3126C0; Sun, 5 Apr 2026 23:56:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433398; cv=none; b=Ktkgw8tCm4B1M0tf3jL02HAufAtci80osFV/OH4W8I317q+FjpP1NskwBwnqSff/9E8YZ8DLW/vO9hayG0BbcOMkFatqsxlXyk5s8hQJ1D/sMeu07pyUqSA3Xc4LprI9XuK4og8f0GbPJQ2nmdcIvrTPGTpHuFu/Jwa+Z1szj4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433398; c=relaxed/simple; bh=5Jab/7lBf0p9Y+zm0mNBBz7PFxQVXiWRK5KI8/o7D7w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PBRSsCLXUMlKbr5z878eW2SPIgq0PTxcHu/lETmXvsMtqsX7H2Bs+nb4STJ+g2KDGPxtFGKTIVF99sPm0dKBY7ADRxixf75z9AtI2JYETW3sRvel367GQmO6oMnabw9i6gibvQvz9A5BUSIDjsPMTZNxvNYt3LN7K4VR+nEGQ4Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QnGoHDW3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QnGoHDW3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 60F8CC116C6; Sun, 5 Apr 2026 23:56:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433398; bh=5Jab/7lBf0p9Y+zm0mNBBz7PFxQVXiWRK5KI8/o7D7w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QnGoHDW3vwcivvmNOjw9o2bOSnSiuXt7aIdxa8w364voeOtuXBDKRMXu1RrUL3xeZ J2FmW1h6MmTnqMjPgvotZtm9XroKgcD0uX7aDtypilDVqaCL8uTlxRvph7lumugK+8 iodWD9nftj/RuaRmrf1nUD8TABFk1CZNavco9mtol/2XT+eI/VlknEJJjda7b6Nt6L Rb/8AMVE63lxKAX080HZgZZI2fWBTcVmYtNiB/2T5n5WhsMv6r77G7q/iT2SdggpN2 ZuLsqQImLYMozcnF9ceFfZNqKay8184qpW7nCgXBZ5baOyb/Njj3jsrriLjAMaitQC h3qzSTuZ7BE+Q== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 17/33] rust: bump `bindgen` minimum supported version to 0.71.1 (Debian Trixie) Date: Mon, 6 Apr 2026 01:52:53 +0200 Message-ID: <20260405235309.418950-18-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" As proposed in the past in e.g. LPC 2025 and the Maintainers Summit [1], we are going to follow Debian Stable's `bindgen` versions as our minimum supported version. Debian Trixie was released with `bindgen` 0.71.1, which it still uses to this day [2]. Debian Trixie's release happened on 2025-08-09 [3], which means that a fair amount of time has passed since its release for kernel developers to upgrade. Thus bump the minimum to the new version. Then, in later commits, clean up most of the workarounds and other bits that this upgrade of the minimum allows us. Ubuntu 25.10 also has a recent enough `bindgen` [4] (even the already unsupported Ubuntu 25.04 had it), and they also provide versioned packages with `bindgen` 0.71.1 back to Ubuntu 24.04 LTS [5]. Link: https://lwn.net/Articles/1050174/ [1] Link: https://packages.debian.org/trixie/bindgen [2] Link: https://www.debian.org/releases/trixie/ [3] Link: https://packages.ubuntu.com/search?suite=3Dall&searchon=3Dnames&keywo= rds=3Dbindgen [4] Link: https://launchpad.net/ubuntu/+source/rust-bindgen-0.71 [5] Acked-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- Documentation/process/changes.rst | 2 +- scripts/min-tool-version.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/process/changes.rst b/Documentation/process/chan= ges.rst index 474594bd4831..84156d031365 100644 --- a/Documentation/process/changes.rst +++ b/Documentation/process/changes.rst @@ -32,7 +32,7 @@ you probably needn't concern yourself with pcmciautils. GNU C 8.1 gcc --version Clang/LLVM (optional) 15.0.0 clang --version Rust (optional) 1.85.0 rustc --version -bindgen (optional) 0.65.1 bindgen --version +bindgen (optional) 0.71.1 bindgen --version GNU make 4.0 make --version bash 4.2 bash --version binutils 2.30 ld -v diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh index a270ec761f64..b96ec2d379b6 100755 --- a/scripts/min-tool-version.sh +++ b/scripts/min-tool-version.sh @@ -34,7 +34,7 @@ rustc) echo 1.85.0 ;; bindgen) - echo 0.65.1 + echo 0.71.1 ;; *) echo "$1: unknown tool" >&2 --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 979D1382365; Sun, 5 Apr 2026 23:56:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433409; cv=none; b=jv3UxXVdclOjOkliF35wBTz4nb7AtzGTYE9KGbm0VP0htKGLv1dv8MMWl+iIUUOZuXjdbyzGj49iYEOblv+yTosZcQdSZqFwXsvVjSHd7E8yjSwdu4tUiqbAmmuyJGlESRDStS+2xCG8/jNmv0evLTX2WVGaIHYTHbbmbRv0DqA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433409; c=relaxed/simple; bh=sQUuqsYWoQQDl9yxEE9Az9YtqbQefhrhSP8rhldIqmw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=I0LLGM+ooY4iTIxeuK+Chry8RsQppMu2PZjscCQPXouF4ruHLUTcPx4b2OJZHWRu2DeNXRCZUzAUV605fo/R0Ck2/0emest+zkqJbs4Dagz5maLqSdu9tyT32P/DPeCcoRsUY+uCl3lCdhlZ4j6BAqeL4e0rRRYXUC+f7sIO2hA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J75yujqh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="J75yujqh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8B450C116C6; Sun, 5 Apr 2026 23:56:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433409; bh=sQUuqsYWoQQDl9yxEE9Az9YtqbQefhrhSP8rhldIqmw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J75yujqhKFFuRX3GexxH2MvDnyBAcdTMIKhI0rNoTW15zw9TzUSxe27UepZvWE18X sub3LugioC9w0xL+97ng102uzKndH8Ef/fjF5HpT6cFS3fEq4Egi4GCNsRUa5Zu7mF ghvVrRnth7f8i1zaluS9EMfBoMQ6edcxRkjuwMamJd6VVZq13aoqCDwQFlUnwhXXER Qli7u2f6YsZ6TrACIbajwtOLeo23srQOGUoscbrDvlMePGirOBgt0tq/xfktxKtt3s F2UVROBeYqdnAEr10BJqZbI75EHII4oVRwiT7p2M42R6Wiky1MPlMLBmszZvTLKzsu NMb1Zpm8DdMBw== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 18/33] rust: rust_is_available: remove warning for `bindgen` 0.66.[01] Date: Mon, 6 Apr 2026 01:52:54 +0200 Message-ID: <20260405235309.418950-19-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" It is not possible anymore to fall into the issue that this warning was alerting about given the `bindgen` version bump. Thus simplify by removing the machinery behind it, including tests. Reviewed-by: Tamir Duberstein Signed-off-by: Miguel Ojeda --- scripts/rust_is_available.sh | 13 ------------ scripts/rust_is_available_bindgen_0_66.h | 2 -- scripts/rust_is_available_test.py | 26 +++--------------------- 3 files changed, 3 insertions(+), 38 deletions(-) delete mode 100644 scripts/rust_is_available_bindgen_0_66.h diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh index d2323de0692c..77896e31dab5 100755 --- a/scripts/rust_is_available.sh +++ b/scripts/rust_is_available.sh @@ -163,19 +163,6 @@ if [ "$rust_bindings_generator_cversion" -lt "$rust_bi= ndings_generator_min_cvers echo >&2 "***" exit 1 fi -if [ "$rust_bindings_generator_cversion" -eq 6600 ] || - [ "$rust_bindings_generator_cversion" -eq 6601 ]; then - # Distributions may have patched the issue (e.g. Debian did). - if ! "$BINDGEN" $(dirname $0)/rust_is_available_bindgen_0_66.h >/dev/null= ; then - echo >&2 "***" - echo >&2 "*** Rust bindings generator '$BINDGEN' versions 0.66.0 and 0.6= 6.1 may not" - echo >&2 "*** work due to a bug (https://github.com/rust-lang/rust-bindg= en/pull/2567)," - echo >&2 "*** unless patched (like Debian's)." - echo >&2 "*** Your version: $rust_bindings_generator_version" - echo >&2 "***" - warning=3D1 - fi -fi =20 # Check that the `libclang` used by the Rust bindings generator is suitabl= e. # diff --git a/scripts/rust_is_available_bindgen_0_66.h b/scripts/rust_is_ava= ilable_bindgen_0_66.h deleted file mode 100644 index c0431293421c..000000000000 --- a/scripts/rust_is_available_bindgen_0_66.h +++ /dev/null @@ -1,2 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#define A "\0" diff --git a/scripts/rust_is_available_test.py b/scripts/rust_is_available_= test.py index 4fcc319dea84..b66fa5933844 100755 --- a/scripts/rust_is_available_test.py +++ b/scripts/rust_is_available_test.py @@ -54,17 +54,12 @@ else: """) =20 @classmethod - def generate_bindgen(cls, version_stdout, libclang_stderr, version_0_6= 6_patched=3DFalse, libclang_concat_patched=3DFalse): + def generate_bindgen(cls, version_stdout, libclang_stderr, libclang_co= ncat_patched=3DFalse): if libclang_stderr is None: libclang_case =3D f"raise SystemExit({cls.bindgen_default_bind= gen_libclang_failure_exit_code})" else: libclang_case =3D f"print({repr(libclang_stderr)}, file=3Dsys.= stderr)" =20 - if version_0_66_patched: - version_0_66_case =3D "pass" - else: - version_0_66_case =3D "raise SystemExit(1)" - if libclang_concat_patched: libclang_concat_case =3D "print('pub static mut foofoo: ::std:= :os::raw::c_int;')" else: @@ -74,8 +69,6 @@ else: import sys if "rust_is_available_bindgen_libclang.h" in " ".join(sys.argv): {libclang_case} -elif "rust_is_available_bindgen_0_66.h" in " ".join(sys.argv): - {version_0_66_case} elif "rust_is_available_bindgen_libclang_concat.h" in " ".join(sys.argv): {libclang_concat_case} else: @@ -83,8 +76,8 @@ else: """) =20 @classmethod - def generate_bindgen_version(cls, stdout, version_0_66_patched=3DFalse= ): - return cls.generate_bindgen(stdout, cls.bindgen_default_bindgen_li= bclang_stderr, version_0_66_patched) + def generate_bindgen_version(cls, stdout): + return cls.generate_bindgen(stdout, cls.bindgen_default_bindgen_li= bclang_stderr) =20 @classmethod def generate_bindgen_libclang_failure(cls): @@ -245,19 +238,6 @@ else: result =3D self.run_script(self.Expected.FAILURE, { "BINDGEN": bin= dgen }) self.assertIn(f"Rust bindings generator '{bindgen}' is too old.", = result.stderr) =20 - def test_bindgen_bad_version_0_66_0_and_0_66_1(self): - for version in ("0.66.0", "0.66.1"): - with self.subTest(version=3Dversion): - bindgen =3D self.generate_bindgen_version(f"bindgen {versi= on}") - result =3D self.run_script(self.Expected.SUCCESS_WITH_WARN= INGS, { "BINDGEN": bindgen }) - self.assertIn(f"Rust bindings generator '{bindgen}' versio= ns 0.66.0 and 0.66.1 may not", result.stderr) - - def test_bindgen_bad_version_0_66_0_and_0_66_1_patched(self): - for version in ("0.66.0", "0.66.1"): - with self.subTest(version=3Dversion): - bindgen =3D self.generate_bindgen_version(f"bindgen {versi= on}", True) - result =3D self.run_script(self.Expected.SUCCESS, { "BINDG= EN": bindgen }) - def test_bindgen_libclang_failure(self): bindgen =3D self.generate_bindgen_libclang_failure() result =3D self.run_script(self.Expected.FAILURE, { "BINDGEN": bin= dgen }) --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E87FC382365; Sun, 5 Apr 2026 23:57:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433421; cv=none; b=IMGLUY3yPRkyOSm5+ORD2Cu0yahOXI4V2WsOVLOqj+NPInIDhxbOl/XLsFXUaj3LVjXHo1ajKnd/xWGhUI7VXKnIDxiFBh4r+PrBH5pN1M0OqN2OITfyj4IqKIhnu6MpHIdZy3gqmqjmrNjUCtlY/wluP2cKryXffblsojYB8q0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433421; c=relaxed/simple; bh=vrwAV7Bl6fj3wm5bdA1SVbLh83q3Kq+DPrhsVUmDW5g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=le7XYEZAMBC9REx4UwDmxSc0TmYnsMe8mJpXdcH4VIyuF1KoFUA5cCVVaIaXvJGRMb5aeIBBdfaJaH9RGA7OXlDLnBGIWv+QYy7ykjU/dSwgWpyJKo12HUG5NGAmo3aU1ifqGaxiiCQZsv8aZKDpC1i5x5lUcVSANElINfeRp8c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZiwyuKsC; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZiwyuKsC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B153CC19425; Sun, 5 Apr 2026 23:56:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433420; bh=vrwAV7Bl6fj3wm5bdA1SVbLh83q3Kq+DPrhsVUmDW5g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZiwyuKsCF/ioWYt/NU05o38dAFYnn7AcopnYIUawB69WLhy7XUSsc1QkcPxQTz5NB Nv59AN39BWOY6GvSMoLn/qG3TYbCTyf449BK0i5ys4oUhcYAJ6THwXleoHmn+GNVwT l+R+0Qvf1Tdj8vgB0GvIcL4wKcAcN94vrKqH91GKOnVJXkBylCRfUCh7v4kw938t0f e+TnxHa1aSvsYnW3UVvLAZGP42Fn+4nOOTtLxAW15o0YhdPIrNPoWXBLUeIyLmced1 /IN2BPutIO9yCe3kCWcarPLQl4/DtUxCuq+Rhyk0ZoQF9S3QLNwDBd7p0XhsPMzRTK BTzlmBwyK7CPQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 19/33] rust: rust_is_available: remove warning for `bindgen` < 0.69.5 && libclang >= 19.1 Date: Mon, 6 Apr 2026 01:52:55 +0200 Message-ID: <20260405235309.418950-20-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" It is not possible anymore to fall into the issue that this warning was alerting about given the `bindgen` version bump. Thus simplify by removing the machinery behind it, including tests. Reviewed-by: Tamir Duberstein Signed-off-by: Miguel Ojeda --- scripts/rust_is_available.sh | 15 -------- ...ust_is_available_bindgen_libclang_concat.h | 3 -- scripts/rust_is_available_test.py | 34 +------------------ 3 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 scripts/rust_is_available_bindgen_libclang_concat.h diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh index 77896e31dab5..cefc456c2503 100755 --- a/scripts/rust_is_available.sh +++ b/scripts/rust_is_available.sh @@ -214,21 +214,6 @@ if [ "$bindgen_libclang_cversion" -lt "$bindgen_libcla= ng_min_cversion" ]; then exit 1 fi =20 -if [ "$bindgen_libclang_cversion" -ge 1900100 ] && - [ "$rust_bindings_generator_cversion" -lt 6905 ]; then - # Distributions may have patched the issue (e.g. Debian did). - if ! "$BINDGEN" $(dirname $0)/rust_is_available_bindgen_libclang_concat.h= | grep -q foofoo; then - echo >&2 "***" - echo >&2 "*** Rust bindings generator '$BINDGEN' < 0.69.5 together with = libclang >=3D 19.1" - echo >&2 "*** may not work due to a bug (https://github.com/rust-lang/ru= st-bindgen/pull/2824)," - echo >&2 "*** unless patched (like Debian's)." - echo >&2 "*** Your bindgen version: $rust_bindings_generator_version" - echo >&2 "*** Your libclang version: $bindgen_libclang_version" - echo >&2 "***" - warning=3D1 - fi -fi - # If the C compiler is Clang, then we can also check whether its version # matches the `libclang` version used by the Rust bindings generator. # diff --git a/scripts/rust_is_available_bindgen_libclang_concat.h b/scripts/= rust_is_available_bindgen_libclang_concat.h deleted file mode 100644 index efc6e98d0f1d..000000000000 --- a/scripts/rust_is_available_bindgen_libclang_concat.h +++ /dev/null @@ -1,3 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#define F(x) int x##x -F(foo); diff --git a/scripts/rust_is_available_test.py b/scripts/rust_is_available_= test.py index b66fa5933844..d6d54b7ea42a 100755 --- a/scripts/rust_is_available_test.py +++ b/scripts/rust_is_available_test.py @@ -54,23 +54,16 @@ else: """) =20 @classmethod - def generate_bindgen(cls, version_stdout, libclang_stderr, libclang_co= ncat_patched=3DFalse): + def generate_bindgen(cls, version_stdout, libclang_stderr): if libclang_stderr is None: libclang_case =3D f"raise SystemExit({cls.bindgen_default_bind= gen_libclang_failure_exit_code})" else: libclang_case =3D f"print({repr(libclang_stderr)}, file=3Dsys.= stderr)" =20 - if libclang_concat_patched: - libclang_concat_case =3D "print('pub static mut foofoo: ::std:= :os::raw::c_int;')" - else: - libclang_concat_case =3D "pass" - return cls.generate_executable(f"""#!/usr/bin/env python3 import sys if "rust_is_available_bindgen_libclang.h" in " ".join(sys.argv): {libclang_case} -elif "rust_is_available_bindgen_libclang_concat.h" in " ".join(sys.argv): - {libclang_concat_case} else: print({repr(version_stdout)}) """) @@ -255,31 +248,6 @@ else: result =3D self.run_script(self.Expected.FAILURE, { "BINDGEN": bin= dgen }) self.assertIn(f"libclang (used by the Rust bindings generator '{bi= ndgen}') is too old.", result.stderr) =20 - def test_bindgen_bad_libclang_concat(self): - for (bindgen_version, libclang_version, expected_not_patched) in ( - ("0.69.4", "18.0.0", self.Expected.SUCCESS), - ("0.69.4", "19.1.0", self.Expected.SUCCESS_WITH_WARNINGS), - ("0.69.4", "19.2.0", self.Expected.SUCCESS_WITH_WARNINGS), - - ("0.69.5", "18.0.0", self.Expected.SUCCESS), - ("0.69.5", "19.1.0", self.Expected.SUCCESS), - ("0.69.5", "19.2.0", self.Expected.SUCCESS), - - ("0.70.0", "18.0.0", self.Expected.SUCCESS), - ("0.70.0", "19.1.0", self.Expected.SUCCESS), - ("0.70.0", "19.2.0", self.Expected.SUCCESS), - ): - with self.subTest(bindgen_version=3Dbindgen_version, libclang_= version=3Dlibclang_version): - cc =3D self.generate_clang(f"clang version {libclang_versi= on}") - libclang_stderr =3D f"scripts/rust_is_available_bindgen_li= bclang.h:2:9: warning: clang version {libclang_version} [-W#pragma-messages= ], err: false" - bindgen =3D self.generate_bindgen(f"bindgen {bindgen_versi= on}", libclang_stderr) - result =3D self.run_script(expected_not_patched, { "BINDGE= N": bindgen, "CC": cc }) - if expected_not_patched =3D=3D self.Expected.SUCCESS_WITH_= WARNINGS: - self.assertIn(f"Rust bindings generator '{bindgen}' < = 0.69.5 together with libclang >=3D 19.1", result.stderr) - - bindgen =3D self.generate_bindgen(f"bindgen {bindgen_versi= on}", libclang_stderr, libclang_concat_patched=3DTrue) - result =3D self.run_script(self.Expected.SUCCESS, { "BINDG= EN": bindgen, "CC": cc }) - def test_clang_matches_bindgen_libclang_different_bindgen(self): bindgen =3D self.generate_bindgen_libclang("scripts/rust_is_availa= ble_bindgen_libclang.h:2:9: warning: clang version 999.0.0 [-W#pragma-messa= ges], err: false") result =3D self.run_script(self.Expected.SUCCESS_WITH_WARNINGS, { = "BINDGEN": bindgen }) --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A835D38552A; Sun, 5 Apr 2026 23:57:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433431; cv=none; b=cevobHQhG3oC/FoAH73VmcX7AJn2WVMXLTCEiQFgIFFS/ixg+jRkNMpF4cpHGKggzewzWA0SWQSBOQeLgQYj9WJ3JFHHLdBMmfFOiZgS/yFOem4LDCUy0ygrVVccDrM+JmOMxmZrpOAw7e+m3Bp6s4x9nz/hB1nra5H5+14nEO8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433431; c=relaxed/simple; bh=IRt9MhYeBO0++hWWCjmyX0eYSozz5sufq57E0UcpLrc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jXmKhWD3bHUjlazR7KAnfwHR0lsMgMHNPhNOkOv3YK/cnWPHA3L+aakDWjtTfQEdZC6JvFJ/ZZ1k6oNIZZ2prF/0vI2Q+GY45jDn20Fkja8uu/Hh8ZC4g0vNcZzJlRjGMOs3gUZ3QD9+Fv2gIahywgW6HojILDo6LfeIJfyaXu0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sjMfFJzy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sjMfFJzy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D849BC2BC9E; Sun, 5 Apr 2026 23:57:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433431; bh=IRt9MhYeBO0++hWWCjmyX0eYSozz5sufq57E0UcpLrc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sjMfFJzy5gkgRHkNpL+Rrzg29TE6lfhKgKvGE/mRM4pSeUJKdNXGRzwTBpSsWjZxF 5TcuobtvROn3nG8N8jTFVTYyBbdd4WJ8k3PoxaWn2JRFtEayqFJJ+TyEHWBr4ixb6d huAo6J2g/V9pJIndQG8BbX2FDy7/Swlfqo0yCCLL/nqEuQWO4h8ZB2UTc/+FCi6TKn J53d7PSkxc/4XOykjk3qZn9OAY3uq5SdOumTONU7QLdwZfA78JXqUAWFOHTcTMeC/8 ZZ4WD6SNGpjWYRUf1wSyCCrmyZscYQRP2ps7rZ7YD2RE4RNR0qpCl4FKzDJ9XT5JWN orKj9ro+iCbvw== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 20/33] rust: kbuild: update `bindgen --rust-target` version and replace comment Date: Mon, 6 Apr 2026 01:52:56 +0200 Message-ID: <20260405235309.418950-21-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" As the comment in the `Makefile` explains, previously, we needed to limit ourselves to the list of Rust versions known by `bindgen` for its `--rust-target` option [1]. In other words, we needed to consult the versions known by the minimum version of `bindgen` that we supported. Now that we bumped the minimum version of `bindgen`, that limitation does not apply anymore since `bindgen` 0.71.0 [2]. Thus replace the comment and simply write our minimum supported Rust version there, which is much simpler. See commit 7a5f93ea5862 ("rust: kbuild: set `bindgen`'s Rust target version") for more details. Link: https://rust-lang.zulipchat.com/#narrow/channel/425075-rust-for-linux= /topic/rust.20version.20on.20generated.20bindings/near/484087179 [1] Link: https://github.com/rust-lang/rust-bindgen/pull/2993 [2] Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- rust/Makefile | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/rust/Makefile b/rust/Makefile index 54498cb5b851..866f9afc1b7f 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -441,22 +441,10 @@ endif # architecture instead of generating `usize`. bindgen_c_flags_final =3D $(bindgen_c_flags_lto) -fno-builtin -D__BINDGEN__ =20 -# Each `bindgen` release may upgrade the list of Rust target versions. By -# default, the highest stable release in their list is used. Thus we need = to set -# a `--rust-target` to avoid future `bindgen` releases emitting code that -# `rustc` may not understand. On top of that, `bindgen` does not support p= assing -# an unknown Rust target version. -# -# Therefore, the Rust target for `bindgen` can be only as high as the mini= mum -# Rust version the kernel supports and only as high as the greatest stable= Rust -# target supported by the minimum `bindgen` version the kernel supports (t= hat -# is, if we do not test the actual `rustc`/`bindgen` versions running). -# -# Starting with `bindgen` 0.71.0, we will be able to set any future Rust v= ersion -# instead, i.e. we will be able to set here our minimum supported Rust ver= sion. +# `--rust-target` points to our minimum supported Rust version. quiet_cmd_bindgen =3D BINDGEN $@ cmd_bindgen =3D \ - $(BINDGEN) $< $(bindgen_target_flags) --rust-target 1.68 \ + $(BINDGEN) $< $(bindgen_target_flags) --rust-target 1.85 \ --use-core --with-derive-default --ctypes-prefix ffi --no-layout-tests \ --no-debug '.*' --enable-function-attribute-detection \ -o $@ -- $(bindgen_c_flags_final) -DMODULE \ --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 03EA6385517; Sun, 5 Apr 2026 23:57:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433443; cv=none; b=WRECv2qym/gXUs74R/Ojm3flcxvEVNh7/c6+5hdPn07ApQcPUTrqCR+Dn9wCGohXFHfN4nyf3OFA/LMko9DoXFdVVGVhYcHcJXxMw0iScWVWXauoG6cPpw2+048MS8USK2+PeHMAkQ+8isaMdZvIbrNZPqjrhPRNuveAL5j3HPU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433443; c=relaxed/simple; bh=XZyHv6AFE6cmv/ci+lWKAs2VwcRp1H9PWrMqDiQ41HQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z1yA+OC8FbCaccgKjmhie+DbZ0zytb2QWmOYpEB/mMh+0hp6lhpgx3fp57F0NskmjfLJEQGUJjI13148rdMri7pm5z5bQtsdvgsG7DqiRT9ObTeh9XRkS2QjOpmYw9y7r2WGlqWMEMdlkDJpCM84XODil6XXgVh4MML8PqI4ZIM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=llFqKXX3; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="llFqKXX3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 10949C2BCB3; Sun, 5 Apr 2026 23:57:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433442; bh=XZyHv6AFE6cmv/ci+lWKAs2VwcRp1H9PWrMqDiQ41HQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=llFqKXX3BZhcl6VND0xHYadZ8I90nL/Woj5hHanZbnt3IKcLSOJsHvkq4HpI4Wt7r bZVadLLw+nnOLT+Z2kB4ju6MGNAxV0aRKH0P0af8CkwUh6tmO6LXNHSVs5GNb61qHF QSf81p6n8bjtPRo9I+2JrQqrY5n0gUQDEpxwa7TktFW2aRXbee3+U3ZbrFE0Swi4dh fPLZy9FLAI1gPwoqHIz4FoVb/FnJGCdo/fsjAJIgXd//f8g4wp69/OmOZNIf0VClpz e6MvHJFjTyYnZMvfpSV6wxeUhIliIUyz92jABICZcbEVHbnfcORnj/PLOyNgZUpnUX UXHG6CWkmko4g== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 21/33] rust: kbuild: remove "dummy parameter" workaround for `bindgen` < 0.71.1 Date: Mon, 6 Apr 2026 01:52:57 +0200 Message-ID: <20260405235309.418950-22-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Until the version bump of `bindgen`, we needed to pass a dummy parameter to avoid failing the `--version` call. Thus remove it. Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- init/Kconfig | 7 +------ scripts/rust_is_available.sh | 8 +------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/init/Kconfig b/init/Kconfig index f9fac458e4d4..d9b795f70a38 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -2211,12 +2211,7 @@ config RUSTC_VERSION_TEXT config BINDGEN_VERSION_TEXT string depends on RUST - # The dummy parameter `workaround-for-0.69.0` is required to support 0.69= .0 - # (https://github.com/rust-lang/rust-bindgen/pull/2678) and 0.71.0 - # (https://github.com/rust-lang/rust-bindgen/pull/3040). It can be removed - # when the minimum version is upgraded past the latter (0.69.1 and 0.71.1 - # both fixed the issue). - default "$(shell,$(BINDGEN) --version workaround-for-0.69.0 2>/dev/null)" + default "$(shell,$(BINDGEN) --version 2>/dev/null)" =20 # # Place an empty function call at each tracepoint site. Can be diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh index cefc456c2503..551f1ebd0dcb 100755 --- a/scripts/rust_is_available.sh +++ b/scripts/rust_is_available.sh @@ -121,14 +121,8 @@ fi # Check that the Rust bindings generator is suitable. # # Non-stable and distributions' versions may have a version suffix, e.g. `= -dev`. -# -# The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0 -# (https://github.com/rust-lang/rust-bindgen/pull/2678) and 0.71.0 -# (https://github.com/rust-lang/rust-bindgen/pull/3040). It can be removed= when -# the minimum version is upgraded past the latter (0.69.1 and 0.71.1 both = fixed -# the issue). rust_bindings_generator_output=3D$( \ - LC_ALL=3DC "$BINDGEN" --version workaround-for-0.69.0 2>/dev/null + LC_ALL=3DC "$BINDGEN" --version 2>/dev/null ) || rust_bindings_generator_code=3D$? if [ -n "$rust_bindings_generator_code" ]; then echo >&2 "***" --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3C4DE385516; Sun, 5 Apr 2026 23:57:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433454; cv=none; b=jmACj63zlSwnXnZl6S7mdRvmtyHYQ0HdTTuWVV9sjCvIxCw+SWNgYZFaRiCeoq6bJHUj9qf7sPalGiD4qwHvZUr4b3Er9x5UkSrUP2TFPwPi7OSfqaLfe2Vfh6LdE129blH0VWwTYrOuNCnNQwrdHt4SRXPctbBT6L+ojlT2K7g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433454; c=relaxed/simple; bh=y0xktRKRs5ryJC+G01aE6htP3MJxSFsUvP6UYzkishw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZTXSzMKtQfzVjXgvdy0Y6utus6jZ1jDTHlCBJv0OY0jxtE4E5KBu06cjq7ijtdbv8RGW2F1ua/AReBxl7If4A3iDJM3M9YjvTWtbDyE3FRVJPuhnc3vK/7boyWYKEsYTV80cqY2ugMxZY3Ks4GRHyPHEBN/q7AvPT4Ramt53OnU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fZa94a2g; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fZa94a2g" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3E412C116C6; Sun, 5 Apr 2026 23:57:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433453; bh=y0xktRKRs5ryJC+G01aE6htP3MJxSFsUvP6UYzkishw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fZa94a2gUM+1/bUwa8Gk/haFENqG5HQ/kAPWfZKfoOpgs9LPvPn+5SYdTLlTrdqBN KhCyK2P/VjNgBuSBZRXH3t/NjrffsRCHyuBlWMIBQFw1QoF5qZOq0Fan1XeP/C9mwN mSmbpbCFTZr9ULdOVc2ZcG2LEkvGQJ8xFnLh+51z3NbAT8m8LjGsjXlDkeOe8MrFSS pua0Sbcn0dOpLzsRowI5EISEDL74bEj9qX5mI82scX4NoyYe3aG+R/HAcXyIsZeQm+ 9Z0TPjgH5LdiQErUVz5M6qCBLJlmLC7RcmmO+rD7FdR+Z/0Ev92RuP1DJXKaj2QiNp MCtFh4b1E1+eg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 22/33] docs: rust: quick-start: openSUSE provides `rust-src` package nowadays Date: Mon, 6 Apr 2026 01:52:58 +0200 Message-ID: <20260405235309.418950-23-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Both openSUSE Tumbleweed and Slowroll provide the `rust-src` package nowadays [1]. Thus remove the version-specific one from the Quick Start guide. Link: https://software.opensuse.org/package/rust-src?search_term=3Drust-src= [1] Reviewed-by: Tamir Duberstein Signed-off-by: Miguel Ojeda --- Documentation/rust/quick-start.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index 152289f0bed2..642efce04ee8 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -84,7 +84,7 @@ openSUSE openSUSE Slowroll and openSUSE Tumbleweed provide recent Rust releases and= thus they should generally work out of the box, e.g.:: =20 - zypper install rust rust1.79-src rust-bindgen clang + zypper install rust rust-src rust-bindgen clang =20 =20 Ubuntu --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 59E5734253B; Sun, 5 Apr 2026 23:57:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433465; cv=none; b=d0ayqvefG24qBV9yB/LBYRILhJUYq5fK801XSDbyfbf02lmBaVDQmbiKhgkbi5YTZDWYq/AbJkSrcjCM0elm/VxLNqMomp0ADiTR9Ow8KJHUQqJ2StdM+DVb/wEtEmQUUOPK6aMks9nrdSxsi15kkJRkFkG2KrBUxE3FI8Y27lI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433465; c=relaxed/simple; bh=7mv52/ZG4QUnDcOB1zLib3ghxysM4SNZUNBkbqsCd6I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bvkdJJUNOeDiQlvilplXe4gpiIq6J2qTij9PpDNYhmGw7N+wihgsjYQxgGS4NKjSN/RlnUWpZHXSXtjiF4TBOI/lwMlEJnET7qzkNngg3Do4y1/j1bAwjRR6ulkxGKun+NAQ8o8GDXgZ0vvBvhm0L5RZktzJOQGokZ7EDZr322I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fWajgKwf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fWajgKwf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D085C116C6; Sun, 5 Apr 2026 23:57:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433465; bh=7mv52/ZG4QUnDcOB1zLib3ghxysM4SNZUNBkbqsCd6I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fWajgKwfrkdSNkiYnAd9kVPK1GTxxVyj6J8fkBbJmrLEd8CgJanav/phR9AoL3ylx txfRsKu9RyJkL4rGC6RD3J1lxpa9C1fBSZzYpGbeXeZbD3guGiERO3kTGiCHAhtg92 EgiGkmUZ+/W0GJ+7JzQjQgfMYPZT8BWyQe0qXfjMWmH6CabWhNT0oyMw9cRsUMhrb4 4xmAOFIxtQwyfAcrhXC65dsH2AYzCrEmcwkeyxe2CLJSxNlqukCsRdgXYFRU6ozXdz 4B+nAbib/RZGoGdyfYl4J/MgCruSgPuD1K/cXlZHR3jxvKX31DQGGowb/YmjIjlMaf nst7B8vwy2roQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 23/33] docs: rust: quick-start: update Ubuntu versioned packages Date: Mon, 6 Apr 2026 01:52:59 +0200 Message-ID: <20260405235309.418950-24-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Now that the minimum supported Rust version is bumped, bump the versioned Rust packages [1][2][3][4] to that version for Ubuntu in the Quick Start guide. In addition, add "may" to the `RUST_LIB_SRC` line since it does not look like it is needed from a quick test in a Ubuntu 24.04 LTS container. Link: https://packages.ubuntu.com/search?suite=3Dall&searchon=3Dnames&keywo= rds=3Drustc [1] Link: https://packages.ubuntu.com/search?suite=3Dall&searchon=3Dnames&keywo= rds=3Dbindgen [2] Link: https://launchpad.net/ubuntu/+source/rustc-1.85 [3] Link: https://launchpad.net/ubuntu/+source/rust-bindgen-0.71 [4] Reviewed-by: Tamir Duberstein Signed-off-by: Miguel Ojeda --- Documentation/rust/quick-start.rst | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index 642efce04ee8..54fe491deb7d 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -112,33 +112,33 @@ Though Ubuntu 24.04 LTS and older versions still prov= ide recent Rust releases, they require some additional configuration to be set, using the versioned packages, e.g.:: =20 - apt install rustc-1.80 rust-1.80-src bindgen-0.65 rustfmt-1.80 \ - rust-1.80-clippy - ln -s /usr/lib/rust-1.80/bin/rustfmt /usr/bin/rustfmt-1.80 - ln -s /usr/lib/rust-1.80/bin/clippy-driver /usr/bin/clippy-driver-1.80 + apt install rustc-1.85 rust-1.85-src bindgen-0.71 rustfmt-1.85 \ + rust-1.85-clippy + ln -s /usr/lib/rust-1.85/bin/rustfmt /usr/bin/rustfmt-1.85 + ln -s /usr/lib/rust-1.85/bin/clippy-driver /usr/bin/clippy-driver-1.85 =20 None of these packages set their tools as defaults; therefore they should = be specified explicitly, e.g.:: =20 - make LLVM=3D1 RUSTC=3Drustc-1.80 RUSTDOC=3Drustdoc-1.80 RUSTFMT=3Drustfmt= -1.80 \ - CLIPPY_DRIVER=3Dclippy-driver-1.80 BINDGEN=3Dbindgen-0.65 + make LLVM=3D1 RUSTC=3Drustc-1.85 RUSTDOC=3Drustdoc-1.85 RUSTFMT=3Drustfmt= -1.85 \ + CLIPPY_DRIVER=3Dclippy-driver-1.85 BINDGEN=3Dbindgen-0.71 =20 -Alternatively, modify the ``PATH`` variable to place the Rust 1.80 binaries +Alternatively, modify the ``PATH`` variable to place the Rust 1.85 binaries first and set ``bindgen`` as the default, e.g.:: =20 - PATH=3D/usr/lib/rust-1.80/bin:$PATH + PATH=3D/usr/lib/rust-1.85/bin:$PATH update-alternatives --install /usr/bin/bindgen bindgen \ - /usr/bin/bindgen-0.65 100 - update-alternatives --set bindgen /usr/bin/bindgen-0.65 + /usr/bin/bindgen-0.71 100 + update-alternatives --set bindgen /usr/bin/bindgen-0.71 =20 -``RUST_LIB_SRC`` needs to be set when using the versioned packages, e.g.:: +``RUST_LIB_SRC`` may need to be set when using the versioned packages, e.g= .:: =20 - RUST_LIB_SRC=3D/usr/src/rustc-$(rustc-1.80 --version | cut -d' ' -f2)/lib= rary + RUST_LIB_SRC=3D/usr/src/rustc-$(rustc-1.85 --version | cut -d' ' -f2)/lib= rary =20 For convenience, ``RUST_LIB_SRC`` can be exported to the global environmen= t. =20 -In addition, ``bindgen-0.65`` is available in newer releases (24.04 LTS and -24.10), but it may not be available in older ones (20.04 LTS and 22.04 LTS= ), +In addition, ``bindgen-0.71`` is available in newer releases (24.04 LTS), +but it may not be available in older ones (20.04 LTS and 22.04 LTS), thus ``bindgen`` may need to be built manually (please see below). =20 =20 --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 89368385514; Sun, 5 Apr 2026 23:57:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433476; cv=none; b=SqyFMxKKIOkrK12bEU+624qFcmWPp1FE257mTjd7Qf/0TXDrYDQtTAZQw2aaXPIsHYY8NS7RuOImFW/HG23fR/4RENvxM+VZvcb+AE6ZK4p8BJNZyDN6DlpoXEYkC2EnvIFPKD5hFlSTzLuXXJfYCN6H05ESqobt3AxCPWztKXo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433476; c=relaxed/simple; bh=hONqXGkyEohBL0ahIaQ2+zaacCn47+UE6bNDPSd6pjs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=s0WOxJa6ZClNUASZR30mTP0ZyiZdHnfHggS0WNu78NHkr4rN7ewmyXpbkvur9uSv6hFQEQJvIYssNYRo67hZyl/z4XTR6MZLCP302iXWhqjhs4KLPpAS/qRSWszdmVabYDeO2fSBe3WJwtxjgsGP8joVO6acqlTqEM3wvRXeT6I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XiOSfC+X; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XiOSfC+X" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87E81C116C6; Sun, 5 Apr 2026 23:57:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433476; bh=hONqXGkyEohBL0ahIaQ2+zaacCn47+UE6bNDPSd6pjs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XiOSfC+Xv1sTVseVZ+geqBfsHGu2S9tl0gRfo/vbe06Y7lYJl1eZTbQ/jQ+e8PpUz j11NauOb1/DscQFZ/kQ4vUbkyrUztRKZWLClePiLa6/m2CD7IfQr4O8rUe8dAqmc3m DvTZ+r6H6ksBl8QGEjgLMWjH6COz7TCiqTRRUOskvgVYAsLLFh/VUu5IR1qxtGNhuy oIGZWw1pyBfb4s7PXByYBPY8c+02Qdo2xBcvLDNWHjL3PTLliie1ikz9WSA/nF5LA5 tGpam/Qo2OdKWQ2nVfh7Y234TT+6AtOA/72q6h8NA84SL53Cl1WJ1aroNaFIgVm+Fu 7AemkWrwOJeUA== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 24/33] docs: rust: quick-start: update minimum Ubuntu version Date: Mon, 6 Apr 2026 01:53:00 +0200 Message-ID: <20260405235309.418950-25-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Ubuntu 25.04 is out of support [1], and Ubuntu 25.10 is the latest supported one. Moreover, Ubuntu 25.10 is the first that provides a recent enough Rust given the minimum bump -- they provide 1.85.1 [2]. Thus update it. Link: https://ubuntu.com/about/release-cycle [1] Link: https://packages.ubuntu.com/search?keywords=3Drustc&searchon=3Dnames&= exact=3D1&suite=3Dall§ion=3Dall [2] Reviewed-by: Tamir Duberstein Signed-off-by: Miguel Ojeda Reviewed-by: Nicolas Schier --- Documentation/rust/quick-start.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index 54fe491deb7d..34c39f208333 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -90,7 +90,7 @@ they should generally work out of the box, e.g.:: Ubuntu ****** =20 -25.04 +25.10 ~~~~~ =20 The latest Ubuntu releases provide recent Rust releases and thus they shou= ld --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 70B45385507; Sun, 5 Apr 2026 23:58:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433487; cv=none; b=oPV3QfeLsSBigpYP+64ubVUz2A05JGTBYrreOgq3NhTcUsXy+3v29Y7cdDy+AQKUvQpD+zn3T8qJcESsL7jVgV0KT7GPQ+WwCMYP9yvYw+oVnDMB2uz/R2vsPH1jJ4+Q/HjmJnM6k5QLsWNrBlfUgbC3KUCseBsKCzmITwavjhQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433487; c=relaxed/simple; bh=RiSuZnRr3y2scfHkz2vp8jW6HFbs0uY5xnYfEaYRqTM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YdMMDVNKNdyJ4Ee05BP3eo5X4OEBTtdmky2dYYbZUuQY5b+CpLSG6Z+6U1bIQe8ajjoeMQLvSSTusgQvNbWJ6eJ0XuQocqeZPJ+Cn91Eu5ml0khBWOgJL/6onkkC9tvd8xhW2PV65RSepVYFe0Nw3uoSCmlYIj7QSXoBJdcgSDo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VokjiENl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VokjiENl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE552C116C6; Sun, 5 Apr 2026 23:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433487; bh=RiSuZnRr3y2scfHkz2vp8jW6HFbs0uY5xnYfEaYRqTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VokjiENlJV9dB0B9luCVu+V0K+MsbFQQpstGpJRrNFerPk1Ze/BXKxl3SWh8TBwdL b1NskFnumMTSOsxKXehxQf33nsxLq4P6veN16SlIoYp5kz2TY/HoaG2Gyaja6UJD/a h40rjYnIRQ+gR/WRT3N4h3eRKgamBaObTYjIVXrntVDFepXdj89Ba8g7+OqvjI04GD Mj+80hAQAN56FwvokNrQqGmdjCGO7VvLf1uCRZHA6sN3IfBxWUYaR3Ukm0yFEwS9o2 mx9/s35PCkKtK/KCASkOo04FrZESH2BaTob2YKASakdaY14YgzjEgSaLYzpFSEr2m1 zETQJG/hE+uIQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 25/33] docs: rust: quick-start: add Ubuntu 26.04 LTS and remove subsection title Date: Mon, 6 Apr 2026 01:53:01 +0200 Message-ID: <20260405235309.418950-26-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Ubuntu 26.04 LTS (Resolute Raccoon) is scheduled to be released in a few weeks [1], and it has a recent enough Rust toolchain, just like Ubuntu 25.10 has [2][3]. We could update the title and the paragraph, but to simplify and to make it more consistent with the other distributions' sections, let's instead just remove that title. It will also reduce the differences later on to keep it updated. Eventually, when we remove the remaining subsection for older LTSs, Ubuntu should be a small section like the other distributions. Thus remove the title and add the mention of Ubuntu 26.04 LTS. Link: https://documentation.ubuntu.com/release-notes/26.04/schedule/#resolu= te-raccoon-schedule [1] Link: https://packages.ubuntu.com/search?keywords=3Drustc&searchon=3Dnames&= exact=3D1&suite=3Dall§ion=3Dall [2] Link: https://packages.ubuntu.com/search?keywords=3Dbindgen&searchon=3Dname= s&exact=3D1&suite=3Dall§ion=3Dall [3] Reviewed-by: Tamir Duberstein Signed-off-by: Miguel Ojeda Reviewed-by: Nicolas Schier --- Documentation/rust/quick-start.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index 34c39f208333..db08c3a03a4f 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -90,10 +90,7 @@ they should generally work out of the box, e.g.:: Ubuntu ****** =20 -25.10 -~~~~~ - -The latest Ubuntu releases provide recent Rust releases and thus they shou= ld +Ubuntu 25.10 and 26.04 LTS provide recent Rust releases and thus they shou= ld generally work out of the box, e.g.:: =20 apt install rustc rust-src bindgen rustfmt rust-clippy --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D6433385507; Sun, 5 Apr 2026 23:58:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433499; cv=none; b=E2SQfa/L9huyakRBJdH/L4lKsj4gApW0aDWDTCic64Dc7QQUwz1PMB3rfLYTv2tJILOBeP9q+Uo1i/2/4j6OpR0imNWwOGYVFfI4XfhGJDy2Ywmvpix1BEgifllkMX9HVhJBFFpi/78eq2MG8avHYARQyQSc+0+OoVX6nwJp/jw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433499; c=relaxed/simple; bh=vdRBSbeQ7FZbidrLn6kd8GSzb/7/fj0OaPu4ZFPJhzQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M0jINZym8e17VTrVukauoEXcgpd/WvTL+AZ1pPsmLB2AtdBf35+KyYWH9Im1HQeRR6CXIfP97fwSWJARHnBec2jtZ7rwTWqWORCgRJZyfHjniWHJ3P0Ag+fsIzdintWsPd0S67U22jVDctCCHHzuLtTHPIVbgjjr7taiObPejpI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=r5+tm8No; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="r5+tm8No" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D037BC116C6; Sun, 5 Apr 2026 23:58:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433498; bh=vdRBSbeQ7FZbidrLn6kd8GSzb/7/fj0OaPu4ZFPJhzQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r5+tm8NoxyoxTo2ZDOyvP8kkiJ3xBZ7hpfXauFNAXO3Gb6dCfsnC28848xcVhCO8D 4MJxET9Ct/6oio+6ThvDRJjcrh2wzuEU9mUH/esqRrPSTcGpi/3FI9Z++KGpj7YrNK TD+tiMnVi+34Av9UaXTvChMfmmZUPOaoRABGimSG9n08BXDQMruFMCu4J4V3N1kWha agGV3cjkwGCFTajWicKrKACAKflS4H6PECxlavUTdQSjuqxxH/VvGlQW6sJXtflMH9 klArCnRE0K3DkjBNNCLmxT9trMWtHo2pKGeYxJU33C6MyAN0X+zwDsaipBEN3i7dtg VKDwPUc8DDbcg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 26/33] docs: rust: quick-start: remove Gentoo "testing" note Date: Mon, 6 Apr 2026 01:53:02 +0200 Message-ID: <20260405235309.418950-27-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Gentoo does not need the "testing" note, since its packages are recent enough even in the stable branch [1][2]. Thus remove it to simplify the documentation. Link: https://packages.gentoo.org/packages/dev-lang/rust [1] Link: https://packages.gentoo.org/packages/dev-util/bindgen [2] Reviewed-by: Tamir Duberstein Signed-off-by: Miguel Ojeda --- Documentation/rust/quick-start.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index db08c3a03a4f..1518367324fe 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -57,8 +57,8 @@ of the box, e.g.:: Gentoo Linux ************ =20 -Gentoo Linux (and especially the testing branch) provides recent Rust rele= ases -and thus it should generally work out of the box, e.g.:: +Gentoo Linux provides recent Rust releases and thus it should generally wo= rk out +of the box, e.g.:: =20 USE=3D'rust-src rustfmt clippy' emerge dev-lang/rust dev-util/bindgen =20 --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB34D386439; Sun, 5 Apr 2026 23:58:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433510; cv=none; b=KBAs9wqCQ7b1sclu6o7RY5DkStvSlwI5gZxAyfa495PBd/8KooY6HAROeBTQjVx7YEzGtooMU+QfF4xQBon/xgci3mIbayIebnqLZiwGGp7uq2gza7xAqj/ebwDZrF5O9PjNJYCR+irHh4cWgFXywEZJIOlgEk2DdRc1fFk1YSY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433510; c=relaxed/simple; bh=+uAzwzhajFxAA8rib6hw5ihE6F38Ir1uk4Ke8nADAT8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uWqYI3l/in3TWG2nO+qwojS2Dgfh8tPjr5LKePmklZJ+eCvnege+/5+D4liDhaDZF6H7x95EnOlB6h4/AagIYiCWu8QC4uWWIMItS5MxYqky5gDAQnrwSi9Nz7UZqxO7tsPXmNmn0DzPmH4j5OTlHyzh2HnHtXBWXNohf2pvl84= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S0Y52XzG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S0Y52XzG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F14A7C19425; Sun, 5 Apr 2026 23:58:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433509; bh=+uAzwzhajFxAA8rib6hw5ihE6F38Ir1uk4Ke8nADAT8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S0Y52XzGRmB43RgfGDFkHin7pnQro38Xf89fl+vv/EjSwvic8hMveYt5cYlW3nycO deNzfkR1lB2hbs36DJMWohpvE5Oy0p3rMrKJ1hzNYsP/gFxDbBBrYqRDxxAVr9Klde 3WaoLJ6wHtg3BzXSKCQFH0FMysZsko45cPJ05GTdm4/eJVVUxz2U6vcUEdF7Jth0tB 8NGfw2aUbMBlX6YEVe7grn/ZP3D3jAqnEl24sS3j6ofBTvE4dTN8/Ng4Ox6Tmk8ku5 WD8F1YUimCMA/13jnyecrGpIyYsoFKhMKg0YCGt/aA5dxGUmbZDigYCj1+BOErfqzu cHrUifwInMzJQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 27/33] docs: rust: quick-start: remove Nix "unstable channel" note Date: Mon, 6 Apr 2026 01:53:03 +0200 Message-ID: <20260405235309.418950-28-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Nix does not need the "unstable channel" note, since its packages are recent enough even in the stable channel [1][2]. Thus remove it to simplify the documentation. Link: https://search.nixos.org/packages?channel=3D25.11&query=3Drust [1] Link: https://search.nixos.org/packages?channel=3D25.11&query=3Dbindgen [2] Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- Documentation/rust/quick-start.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index 1518367324fe..5bbe059a8fa3 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -68,8 +68,8 @@ of the box, e.g.:: Nix *** =20 -Nix (unstable channel) provides recent Rust releases and thus it should -generally work out of the box, e.g.:: +Nix provides recent Rust releases and thus it should generally work out of= the +box, e.g.:: =20 { pkgs ? import {} }: pkgs.mkShell { --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D7133859C7; Sun, 5 Apr 2026 23:58:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433521; cv=none; b=TnjTnoqgASwqLWgRgtEZqb+MhaT1Q+P98q9UAKnlM3T+iY9I8oZ71vaFzdUEQ2w47oLXUz0DRqJYh+d/MuNVGjP4dEZi3EkyY5GVAHqsQjiiCI5pbzHBuYDl86pbsH/ZFAUKme3qRgvGNkB8LdOCOsgSvYdTStX4Vt/qKxiigJY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433521; c=relaxed/simple; bh=o4Ra+oAdw7COOhgL+wfXvUxGOM6cAL7opNxNq4hxAf0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uARxWAFDHWkgTB+cab0xfB6m5IvpQUAA/SznZPBhM60rqn+r2dnHyAOrQESdArUuB0dYcWQ0kXmkfDzlhhJBnx6f4b1++kxiR62x0Q0o7iLw6qNQBRALGT0yRGc67r6OWv/GOBYcqU1hFbWJyUBpKTS24B5BCfzhmBhiga04bbQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VhX7OHEk; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VhX7OHEk" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21757C2BC9E; Sun, 5 Apr 2026 23:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433520; bh=o4Ra+oAdw7COOhgL+wfXvUxGOM6cAL7opNxNq4hxAf0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VhX7OHEkRS4TngsHiqyFImNeylvupb9nev5vB3T1m4+yQd8SUeAkjDWjcjK0U0vln tpolgmzKqd+q1FhWnq23lvcfT5UiW9ffCGs1MQDRgTwPKT4sE6zhhgIPGmQu6nDZon tXnbT+DvezPf3MGHuw3kcd2PCZiBpCtiGUxvuAcu1hnl4rebmizvzZh71GYihzW3Hq vW0UlPFQQSIheVr/MRAMdM0bPzbwzTtAAP2pBTunipsyJDhE99HZsUoCxTq9e8uW7A w/SejrIbLFy4g8UyPixRpdq489fMG1PQAkc6d3WQaSgh0mCjPwvfmP+2fHNfVBrb3n a7e5Xs+tjrNGQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 28/33] docs: rust: quick-start: remove GDB/Binutils mention Date: Mon, 6 Apr 2026 01:53:04 +0200 Message-ID: <20260405235309.418950-29-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" The versions provided nowadays by even a distribution like Debian Stable (and Debian Old Stable) are newer than those mentioned [1]. Thus remove the workaround. Note that the minimum binutils version in the kernel is still 2.30, so one could argue part of the note is still relevant, but it is unlikely a kernel developer using such an old binutils is enabling Rust on a modern kernel, especially when using distribution toolchains, e.g. the Rust minimum version is not satisfied by Debian Old Stable. So we are at the point where keeping the docs short and relevant for essentially everyone is probably the better trade-off. Link: https://packages.debian.org/search?suite=3Dall&searchon=3Dnames&keywo= rds=3Dbinutils [1] Link: https://lore.kernel.org/all/CANiq72mCpc9=3D2TN_zC4NeDMpFQtPXAFvyiP+gR= Apg2vzspPWmw@mail.gmail.com/ Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- Documentation/rust/quick-start.rst | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Documentation/rust/quick-start.rst b/Documentation/rust/quick-= start.rst index 5bbe059a8fa3..a6ec3fa94d33 100644 --- a/Documentation/rust/quick-start.rst +++ b/Documentation/rust/quick-start.rst @@ -352,12 +352,3 @@ Hacking To dive deeper, take a look at the source code of the samples at ``samples/rust/``, the Rust support code under ``rust/`` and the ``Rust hacking`` menu under ``Kernel hacking``. - -If GDB/Binutils is used and Rust symbols are not getting demangled, the re= ason -is the toolchain does not support Rust's new v0 mangling scheme yet. -There are a few ways out: - -- Install a newer release (GDB >=3D 10.2, Binutils >=3D 2.36). - -- Some versions of GDB (e.g. vanilla GDB 10.1) are able to use - the pre-demangled names embedded in the debug info (``CONFIG_DEBUG_INFO`= `). --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A47C3859F8; Sun, 5 Apr 2026 23:58:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433532; cv=none; b=f8+iY6F3lplP3U4DVTYVLDVvs8mKaewoA7t0QIEzlzjTSRjV2oYHJXADYccBXiRaBRtrsnptM7c4/xx0yrQ88k313m+shf3M2Qb7mLHSQmfvakJ6v5EwM/R1hXkY2Qj0urJZ2md02elb62wrjTPcz0r5kIwqKJATe3ielqiPlyQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433532; c=relaxed/simple; bh=paW6MVyC5RLTn5+ATDoZoKrgzNCf+Tz+wEGksZWPCME=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=b9VO2/jfiMf4Gx6o7I1hzxpu2qJDDBeg3D9JqGtdxK/CsT1N6J61nD1ZP7AeEPtOR3k/w8Xy6p45sSE8w6B66YObDW9YzyIK2i61q5p0Hg7BHqIwmcmaZsOKFnifVhttlo4F4I4cJiduVwXGSUT2bg5Acalf7vDXNTdd0z9aR/E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=b4G/tCdh; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="b4G/tCdh" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 494B1C116C6; Sun, 5 Apr 2026 23:58:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433531; bh=paW6MVyC5RLTn5+ATDoZoKrgzNCf+Tz+wEGksZWPCME=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b4G/tCdhMwNTwMVQKUDIDrqWPgkYw0KiJq9u25hGeSPJ/Fo06XMppoxVc3vyC3Zg0 SXOrQcKPC52AeI6H6lQE7QRYpx0uRJ5sWvDNnmBL0H0XFaNdd9j2T/Bfi9w8ub7jmC 6rduwwEJhBUdftOMJKBE+CncJFa8XaB7TvI7/20GwXEotETkQqvgZF2OjwkfkzHjGF EN4Gw/2Cp9UUQx+5tbW2XMSEMTbGQ9FO9SGecgO/kiWocy8aGKjugZOptUL7F/9KUR 4G7K57s+degp7qGSB4gkNZS/usFeLqSef9x3wrQJUa+nKx05VUYRogGivr7rvLNgN+ ok6cCQqnaLyOg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 29/33] docs: rust: general-information: simplify Kconfig example Date: Mon, 6 Apr 2026 01:53:05 +0200 Message-ID: <20260405235309.418950-30-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" There is no need to use `def_bool y if ` -- one can simply write `def_bool `. In fact, the simpler form is how we actually use them in practice in `init/Kconfig`. Thus simplify the example. Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- Documentation/rust/general-information.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/rust/general-information.rst b/Documentation/rus= t/general-information.rst index 6146b49b6a98..91535b2306ed 100644 --- a/Documentation/rust/general-information.rst +++ b/Documentation/rust/general-information.rst @@ -158,4 +158,4 @@ numerical comparisons, one may define a new Kconfig sym= bol: .. code-block:: kconfig =20 config RUSTC_VERSION_MIN_107900 - def_bool y if RUSTC_VERSION >=3D 107900 + def_bool RUSTC_VERSION >=3D 107900 --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5E155382F0E; Sun, 5 Apr 2026 23:59:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433543; cv=none; b=bP0t8aqe8Up/fKFz48KD8CIectnmr5bQRg51myCfVsdyGrB+Tl7l7w9HLMPzfItNLGl7YJ248OVK6+8wlka6gz0LoQa27DfK3bh34C/XxRejNwFVb30N2f5wk1kZZPIWbBgqvoOyhlKvoXkSWpTKSLN/HnbkYhAjVHR/nazrQkg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433543; c=relaxed/simple; bh=Ob0EURwaNkw6X3vyMiyVx5p4YA+R0YJVDz2zrJCrIDo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BzY1KajOxdyiCsnnwWAW0lAwPlzhzMtVaG+MGjfyTHjHThY1N0Z9zkEk79Om+POJA7UtxHiJZVFAHxjkJsuTN0WzL07btSM57/ipsIpj6pHhu5mJieRhZ4xqWaCE04g05WljFENrRuPQiqCIbsrHHv/Mmv0Sf4s/euqNpnt5wFY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SleieeVb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SleieeVb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A143C2BCB3; Sun, 5 Apr 2026 23:58:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433543; bh=Ob0EURwaNkw6X3vyMiyVx5p4YA+R0YJVDz2zrJCrIDo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SleieeVbsMR48SE9BcctZ4YV0A0xEVGFjeoRP6GlHQMyvsnA+Z+eNY5M1nRYNvIZt 7KJKQ1eAS0XN4P+7lZYxCRTlGoT4Yo6REAwIeZ15tntbQLU27l4ezJWgkxjeMMr/49 LUF6GOW7Da3+WTlOzlrnKsKoO7exsEoWRh8TNQ1lC3JrAaPRLWxkbKeyJMdVY4AYOX aLQBpaVJsAIJR4zR+We0+w1ur56cpRNmQxQ438r8TqBp37meh5kqpX7pe1SRcsFYO+ HWQOezfhNcBXwhtyS3rgo86owQzO6/Z9B0U3MGgKB0QRTYuSuZ7fERNWVNUOdSqPpM eiUz4x+u5NrLw== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 30/33] docs: rust: general-information: use real example Date: Mon, 6 Apr 2026 01:53:06 +0200 Message-ID: <20260405235309.418950-31-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Currently the example in the documentation shows a version-based name for the Kconfig example: RUSTC_VERSION_MIN_107900 The reason behind it was to possibly avoid repetition in case several features used the same minimum. However, we ended up preferring to give them a descriptive name for each feature added even if that could lead to some repetition. In practice, the repetition has not happened so far, and even if it does at some point, it is not a big deal. Thus replace the example in the documentation with one of our current examples (after removing previous ones from the bump), to show how they actually look like, and in case someone `grep`s for it. In addition, it has the advantage that it shows the `RUSTC_HAS_*` pattern we follow in `init/Kconfig`, similar to the C side. Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda --- Documentation/rust/general-information.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/rust/general-information.rst b/Documentation/rus= t/general-information.rst index 91535b2306ed..09234bed272c 100644 --- a/Documentation/rust/general-information.rst +++ b/Documentation/rust/general-information.rst @@ -157,5 +157,5 @@ numerical comparisons, one may define a new Kconfig sym= bol: =20 .. code-block:: kconfig =20 - config RUSTC_VERSION_MIN_107900 - def_bool RUSTC_VERSION >=3D 107900 + config RUSTC_HAS_SPAN_FILE + def_bool RUSTC_VERSION >=3D 108800 --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 68C3723D290; Sun, 5 Apr 2026 23:59:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433554; cv=none; b=L0G6Nd3UiXS6n6GeaIs6UFnTc85j/egTqLwVDOM0H+8wkK0ZFgx3juLkPs6SReKSPG9981T60xZQ8G9FV9cdc0/YkMuXAfp1vyLTmcQztJB11/z00Ox3UfjZc4T4ttxHkF0vZfjMJ1L1WVCu5cn6hpfSIHuFX5nI0yP1EF31050= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433554; c=relaxed/simple; bh=EC1VB1NES14FXvIITVND2HACtu2A9sWHbtpUrkEVsec=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RMBSWCMobdnQ+/kw7NEvZ5onjX652E3OmdhTSBEcKbxJq4+2LkJg5ODYAqYiWO+vKxD7opaxjPoQxRVSeKUu4JQtpoh0+gRaxCEhzsMfO6g5ITXe2EtzmDGV+G8zHIeEpHfvEy0eSmR8BssWxgPo66AGQQBU3aLerj6JD3L7sDw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QMqTAWOB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QMqTAWOB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9338AC116C6; Sun, 5 Apr 2026 23:59:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433554; bh=EC1VB1NES14FXvIITVND2HACtu2A9sWHbtpUrkEVsec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QMqTAWOBeSpPYcbAoAtCT6Zx9rr0Zx9H1IY1Pt9mwwKHjyRs3eukRIfpX6VkjAfJ+ 9DaTqYsAz7K83VFtR9brQaez4p7KXMGM+tCAGzNZqIiZVOssFFFEzFIl7u9lCvYVF1 WaJgQ5+4XiiWhuqLGuIxVnqzu+8VY0MsmwISlvenX5mGXYAwjqBIAnUlbYj3Xef4+K HhATQggifzX8UTvi6AEy18/qA7LNbp/34iGj/xCZTDjgAxMSHId++kvizUeyCvAxzs IMNeKQNjRybFbCKNj2pVFN8dA6dFhOUZK/nNZEIkHfsefEqmE6kQ1zvrh/37qOKv0E gk30P5Wea910g== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH v2 31/33] rust: declare cfi_encoding for lru_status Date: Mon, 6 Apr 2026 01:53:07 +0200 Message-ID: <20260405235309.418950-32-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" From: Alice Ryhl By default bindgen will convert 'enum lru_status' into a typedef for an integer. For the most part, an integer of the same size as the enum results in the correct ABI, but in the specific case of CFI, that is not the case. The CFI encoding is supposed to be the same as a struct called 'lru_status' rather than the name of the underlying native integer type. To fix this, tell bindgen to generate a newtype and set the CFI type explicitly. Note that we need to set the CFI attribute explicitly as bindgen is using repr(transparent), which is otherwise identical to the inner type for ABI purposes. This allows us to remove the page range helper C function in Binder without risking a CFI failure when list_lru_walk calls the provided function pointer. The --with-attribute-custom-enum argument requires bindgen v0.71 or greater. [ In particular, the feature was added in 0.71.0 [1][2]. In addition, `feature(cfi_encoding)` has been available since Rust 1.71.0 [3]. Link: https://github.com/rust-lang/rust-bindgen/issues/2520 [1] Link: https://github.com/rust-lang/rust-bindgen/pull/2866 [2] Link: https://github.com/rust-lang/rust/pull/105452 [3] - Miguel ] My testing procedure was to add this to the android17-6.18 branch and verify that rust_shrink_free_page is successfully called without crash, and verify that it does in fact crash when the cfi_encoding is set to other values. Note that I couldn't test this on android16-6.12 as that branch uses a bindgen version that is too old. Signed-off-by: Alice Ryhl Link: https://patch.msgid.link/20260223-cfi-lru-status-v2-1-89c6448a63a4@go= ogle.com Reviewed-by: Gary Guo [ Rebased on top of the minimum Rust version bump series which provide the required `bindgen` version. - Miguel ] Signed-off-by: Miguel Ojeda --- drivers/android/binder/Makefile | 3 +-- drivers/android/binder/page_range.rs | 6 +++--- drivers/android/binder/page_range_helper.c | 24 ---------------------- drivers/android/binder/page_range_helper.h | 15 -------------- rust/bindgen_parameters | 4 ++++ rust/bindings/bindings_helper.h | 1 - rust/bindings/lib.rs | 1 + rust/uapi/lib.rs | 1 + 8 files changed, 10 insertions(+), 45 deletions(-) delete mode 100644 drivers/android/binder/page_range_helper.c delete mode 100644 drivers/android/binder/page_range_helper.h diff --git a/drivers/android/binder/Makefile b/drivers/android/binder/Makef= ile index 09eabb527fa0..7e0cd9782a8b 100644 --- a/drivers/android/binder/Makefile +++ b/drivers/android/binder/Makefile @@ -5,5 +5,4 @@ obj-$(CONFIG_ANDROID_BINDER_IPC_RUST) +=3D rust_binder.o rust_binder-y :=3D \ rust_binder_main.o \ rust_binderfs.o \ - rust_binder_events.o \ - page_range_helper.o + rust_binder_events.o diff --git a/drivers/android/binder/page_range.rs b/drivers/android/binder/= page_range.rs index fdd97112ef5c..8e9f5c4819d0 100644 --- a/drivers/android/binder/page_range.rs +++ b/drivers/android/binder/page_range.rs @@ -642,15 +642,15 @@ fn drop(self: Pin<&mut Self>) { unsafe { bindings::list_lru_walk( list_lru, - Some(bindings::rust_shrink_free_page_wrap), + Some(rust_shrink_free_page), ptr::null_mut(), nr_to_scan, ) } } =20 -const LRU_SKIP: bindings::lru_status =3D bindings::lru_status_LRU_SKIP; -const LRU_REMOVED_ENTRY: bindings::lru_status =3D bindings::lru_status_LRU= _REMOVED_RETRY; +const LRU_SKIP: bindings::lru_status =3D bindings::lru_status::LRU_SKIP; +const LRU_REMOVED_ENTRY: bindings::lru_status =3D bindings::lru_status::LR= U_REMOVED_RETRY; =20 /// # Safety /// Called by the shrinker. diff --git a/drivers/android/binder/page_range_helper.c b/drivers/android/b= inder/page_range_helper.c deleted file mode 100644 index 496887723ee0..000000000000 --- a/drivers/android/binder/page_range_helper.c +++ /dev/null @@ -1,24 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 - -/* C helper for page_range.rs to work around a CFI violation. - * - * Bindgen currently pretends that `enum lru_status` is the same as an int= eger. - * This assumption is fine ABI-wise, but once you add CFI to the mix, it - * triggers a CFI violation because `enum lru_status` gets a different CFI= tag. - * - * This file contains a workaround until bindgen can be fixed. - * - * Copyright (C) 2025 Google LLC. - */ -#include "page_range_helper.h" - -unsigned int rust_shrink_free_page(struct list_head *item, - struct list_lru_one *list, - void *cb_arg); - -enum lru_status -rust_shrink_free_page_wrap(struct list_head *item, struct list_lru_one *li= st, - void *cb_arg) -{ - return rust_shrink_free_page(item, list, cb_arg); -} diff --git a/drivers/android/binder/page_range_helper.h b/drivers/android/b= inder/page_range_helper.h deleted file mode 100644 index 18dd2dd117b2..000000000000 --- a/drivers/android/binder/page_range_helper.h +++ /dev/null @@ -1,15 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -/* - * Copyright (C) 2025 Google, Inc. - */ - -#ifndef _LINUX_PAGE_RANGE_HELPER_H -#define _LINUX_PAGE_RANGE_HELPER_H - -#include - -enum lru_status -rust_shrink_free_page_wrap(struct list_head *item, struct list_lru_one *li= st, - void *cb_arg); - -#endif /* _LINUX_PAGE_RANGE_HELPER_H */ diff --git a/rust/bindgen_parameters b/rust/bindgen_parameters index 112ec197ef0a..6f02d9720ad2 100644 --- a/rust/bindgen_parameters +++ b/rust/bindgen_parameters @@ -19,6 +19,10 @@ # warning. We don't need to peek into it anyway. --opaque-type spinlock =20 +# enums that appear in indirect function calls should specify a cfi type +--newtype-enum lru_status +--with-attribute-custom-enum=3Dlru_status=3D'#[cfi_encoding=3D"10lru_statu= s"]' + # `seccomp`'s comment gets understood as a doctest --no-doc-comments =20 diff --git a/rust/bindings/bindings_helper.h b/rust/bindings/bindings_helpe= r.h index 083cc44aa952..faf3ee634ced 100644 --- a/rust/bindings/bindings_helper.h +++ b/rust/bindings/bindings_helper.h @@ -149,5 +149,4 @@ const vm_flags_t RUST_CONST_HELPER_VM_NOHUGEPAGE =3D VM= _NOHUGEPAGE; #if IS_ENABLED(CONFIG_ANDROID_BINDER_IPC_RUST) #include "../../drivers/android/binder/rust_binder.h" #include "../../drivers/android/binder/rust_binder_events.h" -#include "../../drivers/android/binder/page_range_helper.h" #endif diff --git a/rust/bindings/lib.rs b/rust/bindings/lib.rs index e18c160dad17..854e7c471434 100644 --- a/rust/bindings/lib.rs +++ b/rust/bindings/lib.rs @@ -19,6 +19,7 @@ unreachable_pub, unsafe_op_in_unsafe_fn )] +#![feature(cfi_encoding)] =20 #[allow(dead_code)] #[allow(clippy::cast_lossless)] diff --git a/rust/uapi/lib.rs b/rust/uapi/lib.rs index 821e286e0daa..b8a515de31ca 100644 --- a/rust/uapi/lib.rs +++ b/rust/uapi/lib.rs @@ -24,6 +24,7 @@ unsafe_op_in_unsafe_fn )] #![cfg_attr(CONFIG_RUSTC_HAS_UNNECESSARY_TRANSMUTES, allow(unnecessary_tra= nsmutes))] +#![feature(cfi_encoding)] =20 // Manual definition of blocklisted types. type __kernel_size_t =3D usize; --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1C853381B15; Sun, 5 Apr 2026 23:59:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433565; cv=none; b=EMJLxzPjx0V5q3MmgmHkX7Lbxh3Me8Rvol5+xhCagbjm0hoXi9iKQzbPn32id94ZJH+ixbms/B357EZ3ZN9JOM5eoglCwLLsednB7ztK11ExKatzf6UEJ/4f2F3KGlsAqnmezQI6zPNvC6NKow+KTJe+fLutuiXLIPHlbcUcFLo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433565; c=relaxed/simple; bh=SkaD63e7WNKd6l91xAXN7lZ/j1nQk4rCvj18hUBSP2A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NX99vRt07xNion4aV6XgQG/tR3fjCBINq5T80jT9n9whnYJh3GUPUuCZZcZXVGE4PUHIBsJ4SrnOO12EwqXbJBi+xzcGS9eiRjoW5svvyWi0P6LiE75NCuURPUltWbQVUAAuGlMAPjmLp7lmJpyeA01NeUNJqk3tDTU7XzZzb/8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qT7JjEap; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qT7JjEap" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88702C19425; Sun, 5 Apr 2026 23:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433565; bh=SkaD63e7WNKd6l91xAXN7lZ/j1nQk4rCvj18hUBSP2A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qT7JjEapMwwAMStY/OKyLpjkMSWC7l6AOMUAZbTuYsHMIjvY52xXT85zs7eiB2Xgl AFDdh6mgB5Gydna3yU3wXgcpzwkDs4aSx6cNQNZ0e1dTpqYMIIMBkWAii7IHMnAqD8 4ysIbgfHPEpw1hwGDIIPRcQLCBrALBijyFC5WmtB4fJ3hm8XzcF/O2djDlnQ/6Tq7T yydjpMBgbjPHzTZ4TFBHyMC9a19+nwOb4Oe5Oc5/Tu8VHIAq9E+LQPpOCzM3N3nhss Xv1nwHfD2DDvzNoVXZQOUwxdGXUViwDb3/t98q3LlFDEp7h4+87E6nc6Z94GB3nHAM SaHAgTLaFtuHg== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH v2 32/33] rust: kbuild: support global per-version flags Date: Mon, 6 Apr 2026 01:53:08 +0200 Message-ID: <20260405235309.418950-33-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" Sometimes it is useful to gate global Rust flags per compiler version. For instance, we may want to disable a lint that has false positives in a single version [1]. We already had helpers like `rustc-min-version` for that, which we use elsewhere, but we cannot currently use them for `rust_common_flags`, which contains the global flags for all Rust code (kernel and host), because `rustc-min-version` depends on `CONFIG_RUSTC_VERSION`, which does not exist when `rust_common_flags` is defined. Thus, to support that, introduce `rust_common_flags_per_version`, defined after the `include/config/auto.conf` inclusion (where `CONFIG_RUSTC_VERSION` becomes available), and append it to `rust_common_flags`, `KBUILD_HOSTRUSTFLAGS` and `KBUILD_RUSTFLAGS`. In addition, move the expansion of `HOSTRUSTFLAGS` to the same place, so that users can also override per-version flags [2]. Link: https://lore.kernel.org/rust-for-linux/CANiq72mWdFU11GcCZRchzhy0Gi1QZ= ShvZtyRkHV2O+WA2uTdVQ@mail.gmail.com/ [1] Link: https://lore.kernel.org/rust-for-linux/CANiq72mTaA2tjhkLKf0-2hrrrt9rx= WPgy6SfNSbponbGOegQvA@mail.gmail.com/ [2] Link: https://patch.msgid.link/20260307170929.153892-1-ojeda@kernel.org Signed-off-by: Miguel Ojeda Acked-by: Nicolas Schier Reviewed-by: Tamir Duberstein --- Makefile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 78f5ee173eda..a305ae4be522 100644 --- a/Makefile +++ b/Makefile @@ -506,7 +506,7 @@ KBUILD_HOSTCFLAGS :=3D $(KBUILD_USERHOSTCFLAGS) $(HOS= T_LFS_CFLAGS) \ KBUILD_HOSTCXXFLAGS :=3D -Wall -O2 $(HOST_LFS_CFLAGS) $(HOSTCXXFLAGS) \ -I $(srctree)/scripts/include KBUILD_HOSTRUSTFLAGS :=3D $(rust_common_flags) -O -Cstrip=3Ddebuginfo \ - -Zallow-features=3D $(HOSTRUSTFLAGS) + -Zallow-features=3D KBUILD_HOSTLDFLAGS :=3D $(HOST_LFS_LDFLAGS) $(HOSTLDFLAGS) KBUILD_HOSTLDLIBS :=3D $(HOST_LFS_LIBS) $(HOSTLDLIBS) KBUILD_PROCMACROLDFLAGS :=3D $(or $(PROCMACROLDFLAGS),$(KBUILD_HOSTLDFLAGS= )) @@ -836,6 +836,14 @@ endif # CONFIG_TRACEPOINTS =20 export WARN_ON_UNUSED_TRACEPOINTS =20 +# Per-version Rust flags. These are like `rust_common_flags`, but may +# depend on the Rust compiler version (e.g. using `rustc-min-version`). +rust_common_flags_per_version :=3D + +rust_common_flags +=3D $(rust_common_flags_per_version) +KBUILD_HOSTRUSTFLAGS +=3D $(rust_common_flags_per_version) $(HOSTRUSTFLAGS) +KBUILD_RUSTFLAGS +=3D $(rust_common_flags_per_version) + include $(srctree)/arch/$(SRCARCH)/Makefile =20 ifdef need-config --=20 2.53.0 From nobody Sun Jun 14 04:43:18 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7A5FC3859DD; Sun, 5 Apr 2026 23:59:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433576; cv=none; b=axq8H96OiXgSpTcsozUoVAG2qvyaeJFgc8pCW90a9TKUnsP2Pel05cnAMtzsXHdBihQhjnA9/Rqlrf5ZPJTfGApk55oxhNX1ZGx7CHRpc5nGF42/oyETMgqWrE6esJMKL0bV9yNe2BqJzAfmD+zaHEpj8lGQkQ3Bn2koEPeHjY4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775433576; c=relaxed/simple; bh=2Y/2ZsxukLFUeyt5kaUbOgODi2Fd7rXroVSx/UF2oZk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uonVEh2RaDa7opq23YcjSZYZURIrGU2rVSSVSrZ7Z+adB5yLbB4cALFupReGtH3UyOSwKCDq64aoBcpZ5+jGLLmTBlusM5p1UuKogoqQ0oKP7P4K0+dZeUuNg/I0abBF8A+Dszuufg/Tw9xRudPmfK+mYDgvzvLw/ASiwhuUapg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Q/niYW5o; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Q/niYW5o" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C50EC116C6; Sun, 5 Apr 2026 23:59:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775433576; bh=2Y/2ZsxukLFUeyt5kaUbOgODi2Fd7rXroVSx/UF2oZk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q/niYW5o9kq4CIk+KISZoZr73cBvrFp7xOgl300ftkoj5yEiq4mi9hUZUG9wJrOv+ LaGbnyH2cbkgtfwDE2ULrSo70uidF2nRVcyCprr/DU1e1LrxTrWpPSqYOrd/b5v+pI vOJs5KWVWeSegIrtH7pNTmgR4B3f8Em0ddPnhF/0hvNjcmD/GNMNZZR9sO/6pyDC8l J00GH2pYJiTb1LuIWnlKsXbnu5aaWOq5VidlqrS6OtTBgrSnGC29aYauevXa7ZXa5s hvE9DHd51uuzsjeydQ/ToRRg+tMim8vYyTCl+sxSxVJ+3eYGI1FrqpdIrkWkqhUHLN LBKSjFseYSZiw== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org, Tamir Duberstein Subject: [PATCH v2 33/33] rust: kbuild: allow `clippy::precedence` for Rust < 1.86.0 Date: Mon, 6 Apr 2026 01:53:09 +0200 Message-ID: <20260405235309.418950-34-ojeda@kernel.org> In-Reply-To: <20260405235309.418950-1-ojeda@kernel.org> References: <20260405235309.418950-1-ojeda@kernel.org> 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" The Clippy `precedence` lint was extended in Rust 1.85.0 to include bitmasking and shift operations [1]. However, because it generated many hits, in Rust 1.86.0 it was split into a new `precedence_bits` lint which is not enabled by default [2]. In other words, only Rust 1.85 has a different behavior. For instance, it reports: warning: operator precedence can trip the unwary --> drivers/gpu/nova-core/fb/hal/ga100.rs:16:5 | 16 | / u64::from(regs::NV_PFB_NISO_FLUSH_SYSMEM_ADDR::read(bar).adr= _39_08()) << FLUSH_SYSMEM_ADDR_SHIFT 17 | | | u64::from(regs::NV_PFB_NISO_FLUSH_SYSMEM_ADDR_HI::read= (bar).adr_63_40()) 18 | | << FLUSH_SYSMEM_ADDR_SHIFT_HI | |_________________________________________^ | =3D help: for further information visit https://rust-lang.github.io/= rust-clippy/master/index.html#precedence =3D note: `-W clippy::precedence` implied by `-W clippy::all` =3D help: to override `-W clippy::all` add `#[allow(clippy::preceden= ce)]` help: consider parenthesizing your expression | 16 ~ (u64::from(regs::NV_PFB_NISO_FLUSH_SYSMEM_ADDR::read(bar).adr_= 39_08()) << FLUSH_SYSMEM_ADDR_SHIFT) | (u64::from(regs::NV_PFB_NISO_FLUSH_S= YSMEM_ADDR_HI::read(bar).adr_63_40()) 17 + << FLUSH_SYSMEM_ADDR_SHIFT_HI) | While so far we try our best to keep all versions Clippy-clean, the minimum (which is now Rust 1.85.0 after the bump) and the latest stable are the most important ones; and this may be considered a "false positive" with respect to the behavior in other versions. Thus allow this lint for this version using the per-version flags mechanism introduced in the previous commit. Link: https://github.com/rust-lang/rust-clippy/issues/14097 [1] Link: https://github.com/rust-lang/rust-clippy/pull/14115 [2] Link: https://lore.kernel.org/rust-for-linux/DFVDKMMA7KPC.2DN0951H3H55Y@ker= nel.org/ Reviewed-by: Tamir Duberstein Reviewed-by: Gary Guo Signed-off-by: Miguel Ojeda Acked-by: Nicolas Schier --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a305ae4be522..b8c38aa49cf4 100644 --- a/Makefile +++ b/Makefile @@ -838,7 +838,8 @@ export WARN_ON_UNUSED_TRACEPOINTS =20 # Per-version Rust flags. These are like `rust_common_flags`, but may # depend on the Rust compiler version (e.g. using `rustc-min-version`). -rust_common_flags_per_version :=3D +rust_common_flags_per_version :=3D \ + $(if $(call rustc-min-version,108600),,-Aclippy::precedence) =20 rust_common_flags +=3D $(rust_common_flags_per_version) KBUILD_HOSTRUSTFLAGS +=3D $(rust_common_flags_per_version) $(HOSTRUSTFLAGS) --=20 2.53.0