[PATCH v8 01/10] rust: enable the `generic_arg_infer` feature

Alexandre Courbot posted 10 patches 1 month ago
There is a newer version of this series
[PATCH v8 01/10] rust: enable the `generic_arg_infer` feature
Posted by Alexandre Courbot 1 month ago
This feature is stable since 1.89, and used in subsequent patches.

Reviewed-by: Gary Guo <gary@garyguo.net>
Tested-by: Dirk Behme <dirk.behme@de.bosch.com>
Acked-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
---
 rust/kernel/lib.rs     | 3 +++
 scripts/Makefile.build | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs
index 3da92f18f4ee..cddeae8b6cb2 100644
--- a/rust/kernel/lib.rs
+++ b/rust/kernel/lib.rs
@@ -37,6 +37,9 @@
 #![feature(const_ptr_write)]
 #![feature(const_refs_to_cell)]
 //
+// Stable since Rust 1.89.0.
+#![feature(generic_arg_infer)]
+//
 // Expected to become stable.
 #![feature(arbitrary_self_types)]
 //
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 32e209bc7985..923886735299 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -314,12 +314,13 @@ $(obj)/%.lst: $(obj)/%.c FORCE
 #   - 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)`.
+#   - Stable since Rust 1.89.0: `feature(generic_arg_infer)`.
 #   - 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 := asm_const,asm_goto,arbitrary_self_types,lint_reasons,offset_of_nested,raw_ref_op,used_with_arg
+rust_allowed_features := asm_const,asm_goto,arbitrary_self_types,generic_arg_infer,lint_reasons,offset_of_nested,raw_ref_op,used_with_arg
 
 # `--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

-- 
2.53.0
Re: [PATCH v8 01/10] rust: enable the `generic_arg_infer` feature
Posted by Yury Norov 4 weeks, 1 day ago
On Tue, Mar 10, 2026 at 12:13:58AM +0900, Alexandre Courbot wrote:
> This feature is stable since 1.89, and used in subsequent patches.
> 
> Reviewed-by: Gary Guo <gary@garyguo.net>
> Tested-by: Dirk Behme <dirk.behme@de.bosch.com>
> Acked-by: Miguel Ojeda <ojeda@kernel.org>
> Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
> ---
>  rust/kernel/lib.rs     | 3 +++
>  scripts/Makefile.build | 3 ++-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs
> index 3da92f18f4ee..cddeae8b6cb2 100644
> --- a/rust/kernel/lib.rs
> +++ b/rust/kernel/lib.rs
> @@ -37,6 +37,9 @@
>  #![feature(const_ptr_write)]
>  #![feature(const_refs_to_cell)]
>  //
> +// Stable since Rust 1.89.0.
> +#![feature(generic_arg_infer)]
> +//
>  // Expected to become stable.
>  #![feature(arbitrary_self_types)]
>  //
> diff --git a/scripts/Makefile.build b/scripts/Makefile.build
> index 32e209bc7985..923886735299 100644
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@ -314,12 +314,13 @@ $(obj)/%.lst: $(obj)/%.c FORCE
>  #   - 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)`.
> +#   - Stable since Rust 1.89.0: `feature(generic_arg_infer)`.
>  #   - 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 := asm_const,asm_goto,arbitrary_self_types,lint_reasons,offset_of_nested,raw_ref_op,used_with_arg
> +rust_allowed_features := asm_const,asm_goto,arbitrary_self_types,generic_arg_infer,lint_reasons,offset_of_nested,raw_ref_op,used_with_arg

Maybe split the line? It's already over 100 chars, and it doesn't seem
to get shorter.

>  
>  # `--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
> 
> -- 
> 2.53.0
Re: [PATCH v8 01/10] rust: enable the `generic_arg_infer` feature
Posted by Miguel Ojeda 4 weeks, 1 day ago
On Wed, Mar 11, 2026 at 1:13 AM Yury Norov <ynorov@nvidia.com> wrote:
>
> Maybe split the line? It's already over 100 chars, and it doesn't seem
> to get shorter.

We are about to bump the minimum to Debian Stable's, 1.85, so it will
become shorter at just about the right time... :)

Cheers,
Miguel