linux-next: manual merge of the rust tree with the origin tree

Mark Brown posted 1 patch 2 days, 12 hours ago
linux-next: manual merge of the rust tree with the origin tree
Posted by Mark Brown 2 days, 12 hours ago
Hi all,

Today's linux-next merge of the rust tree got a conflict in:

  scripts/Makefile.build

between commit:

  f41941aab3acd ("rust: ptr: add projection infrastructure")

from the origin tree and commit:

  560a7a9b9267f ("rust: add `const_assert!` macro")

from the rust tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --cc scripts/Makefile.build
index 3652b85be5459,a6d1a2b210aaa..0000000000000
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@@ -310,7 -310,7 +310,8 @@@ $(obj)/%.lst: $(obj)/%.c FORC
  
  # The features in this list are the ones allowed for non-`rust/` code.
  #
 +#   - Stable since Rust 1.79.0: `feature(slice_ptr_len)`.
+ #   - 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)`.
@@@ -321,7 -320,7 +322,7 @@@
  #
  # 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,slice_ptr_len,strict_provenance,used_with_arg
 -rust_allowed_features := asm_const,asm_goto,arbitrary_self_types,inline_const,lint_reasons,offset_of_nested,raw_ref_op,used_with_arg
++rust_allowed_features := asm_const,asm_goto,arbitrary_self_types,inline_const,lint_reasons,offset_of_nested,raw_ref_op,slice_ptr_lenstrict_provenance,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
Re: linux-next: manual merge of the rust tree with the origin tree
Posted by Gary Guo 2 days, 11 hours ago
On Mon Mar 30, 2026 at 2:17 PM BST, Mark Brown wrote:
> Hi all,
>
> Today's linux-next merge of the rust tree got a conflict in:
>
>   scripts/Makefile.build
>
> between commit:
>
>   f41941aab3acd ("rust: ptr: add projection infrastructure")

This commit is in v7.0-rc4 and later. Miguel, perhaps do a back merge to resolve
the conflict?

>
> from the origin tree and commit:
>
>   560a7a9b9267f ("rust: add `const_assert!` macro")
>
> from the rust tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> diff --cc scripts/Makefile.build
> index 3652b85be5459,a6d1a2b210aaa..0000000000000
> --- a/scripts/Makefile.build
> +++ b/scripts/Makefile.build
> @@@ -310,7 -310,7 +310,8 @@@ $(obj)/%.lst: $(obj)/%.c FORC
>   
>   # The features in this list are the ones allowed for non-`rust/` code.
>   #
>  +#   - Stable since Rust 1.79.0: `feature(slice_ptr_len)`.
> + #   - Stable since Rust 1.79.0: `feature(inline_const)`.

I think we would want the lines to be merged on rust-next. This is fine on
linux-next, though.

>   #   - 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)`.
> @@@ -321,7 -320,7 +322,7 @@@
>   #
>   # 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,slice_ptr_len,strict_provenance,used_with_arg
>  -rust_allowed_features := asm_const,asm_goto,arbitrary_self_types,inline_const,lint_reasons,offset_of_nested,raw_ref_op,used_with_arg
> ++rust_allowed_features := asm_const,asm_goto,arbitrary_self_types,inline_const,lint_reasons,offset_of_nested,raw_ref_op,slice_ptr_lenstrict_provenance,used_with_arg

I think this is missing a comma between slice_ptr_len and strict_provenance.

>   
>   # `--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

Thanks,
Gary
Re: linux-next: manual merge of the rust tree with the origin tree
Posted by Miguel Ojeda 2 days, 11 hours ago
On Mon, Mar 30, 2026 at 3:26 PM Gary Guo <gary@garyguo.net> wrote:
>
> I think this is missing a comma between slice_ptr_len and strict_provenance.

Indeed, it looks like it -- good eyes!

Also, nit: the line

    #   - Stable since Rust 1.79.0: `feature(slice_ptr_len)`,

should use a period instead of a comma at the end. But, actually, to
be consistent with the others, we should probably do:

    #   - Stable since Rust 1.79.0: `feature(slice_ptr_len)`,
    #     `feature(inline_const)`.

To be fair, perhaps we should use the "one per line" style, but meh,
most of this goes away with the bump and we will have another conflict
soon, so it does not matter much.

Thanks!

Cheers,
Miguel
Re: linux-next: manual merge of the rust tree with the origin tree
Posted by Miguel Ojeda 2 days, 11 hours ago
On Mon, Mar 30, 2026 at 3:30 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> should use a period instead of a comma at the end.

Please disregard that bit -- somehow I saw a comma (perhaps recalling
the fix I did in `rust-next` for that commit).

Cheers,
Miguel