public inbox for linux-next@vger.kernel.org
 help / color / mirror / Atom feed
* linux-next: manual merge of the rust tree with the origin tree
@ 2026-04-06 13:02 Mark Brown
  2026-04-06 13:11 ` Miguel Ojeda
  0 siblings, 1 reply; 14+ messages in thread
From: Mark Brown @ 2026-04-06 13:02 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Danilo Krummrich, Gary Guo, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 1888 bytes --]

Hi all,

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

  rust/kernel/lib.rs

between commits:

  08da98f18f4f9 ("rust: ptr: add `KnownSize` trait to support DST size info extraction")
  f41941aab3acd ("rust: ptr: add projection infrastructure")

from the origin tree and commit:

  7fa2b092b1ff8 ("rust: kbuild: remove `feature(...)`s that are now stable")

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 rust/kernel/lib.rs
index d93292d47420f,b48221a5b4ec5..0000000000000
--- a/rust/kernel/lib.rs
+++ b/rust/kernel/lib.rs
@@@ -16,33 -16,9 +16,12 @@@
  // 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)]
- #![feature(slice_ptr_len)]
- //
- // 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)]
- //
 +// Stable since Rust 1.84.0.
 +#![feature(strict_provenance)]
 +//
  // Expected to become stable.
  #![feature(arbitrary_self_types)]
+ #![feature(derive_coerce_pointee)]
  //
  // To be determined.
  #![feature(used_with_arg)]

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread
* linux-next: manual merge of the rust tree with the origin tree
@ 2026-04-06 13:13 Mark Brown
  2026-04-06 13:16 ` Miguel Ojeda
  0 siblings, 1 reply; 14+ messages in thread
From: Mark Brown @ 2026-04-06 13:13 UTC (permalink / raw)
  To: Miguel Ojeda; +Cc: Gary Guo, Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2100 bytes --]

Hi all,

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

  rust/Makefile

between commit:

  dda135077ecc9 ("rust: build: remap path to avoid absolute path")

from the origin tree and commit:

  8980db6e99870 ("rust: kbuild: remove `--remap-path-prefix` workarounds")

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 rust/Makefile
index 9801af2e1e027,866f9afc1b7f8..0000000000000
--- a/rust/Makefile
+++ b/rust/Makefile
@@@ -144,12 -145,7 +145,7 @@@ doctests_modifiers_workaround := $(rust
  quiet_cmd_rustdoc = RUSTDOC $(if $(rustdoc_host),H, ) $<
        cmd_rustdoc = \
  	OBJTREE=$(abspath $(objtree)) \
- 	$(RUSTDOC) $(filter-out $(skip_flags) --remap-path-prefix=% --remap-path-scope=%, \
- 			$(if $(rustdoc_host),$(rust_common_flags),$(rust_flags))) \
 -	$(RUSTDOC) $(filter-out $(skip_flags),$(if $(rustdoc_host),$(rust_common_flags),$(rust_flags))) \
++	$(RUSTDOC) $(filter-out $(skip_flags) --remap-path-scope=%,$(if $(rustdoc_host),$(rust_common_flags),$(rust_flags))) \
  		$(rustc_target_flags) -L$(objtree)/$(obj) \
  		-Zunstable-options --generate-link-to-definition \
  		--output $(rustdoc_output) \
@@@ -335,7 -329,7 +329,7 @@@ quiet_cmd_rustdoc_test_kernel = RUSTDO
  	rm -rf $(objtree)/$(obj)/test/doctests/kernel; \
  	mkdir -p $(objtree)/$(obj)/test/doctests/kernel; \
  	OBJTREE=$(abspath $(objtree)) \
- 	$(RUSTDOC) --test $(filter-out --remap-path-prefix=% --remap-path-scope=%,$(rust_flags)) \
 -	$(RUSTDOC) --test $(rust_flags) \
++	$(RUSTDOC) --test $(filter-out --remap-path-scope=%,$(rust_flags)) \
  		-L$(objtree)/$(obj) --extern ffi --extern pin_init \
  		--extern kernel --extern build_error --extern macros \
  		--extern bindings --extern uapi \

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread
* linux-next: manual merge of the rust tree with the origin tree
@ 2026-04-06 13:12 Mark Brown
  2026-04-06 13:15 ` Miguel Ojeda
  0 siblings, 1 reply; 14+ messages in thread
From: Mark Brown @ 2026-04-06 13:12 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Danilo Krummrich, Gary Guo, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2090 bytes --]

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:

  7fa2b092b1ff8 ("rust: kbuild: remove `feature(...)`s that are now stable")

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,57cff77c28973..0000000000000
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@@ -310,18 -310,13 +310,14 @@@ $(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.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.84.0: `feature(strict_provenance)`.
  #   - 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 := 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 := arbitrary_self_types,asm_goto,used_with_arg
++rust_allowed_features := arbitrary_self_types,asm_goto,slice_ptr_len,strict_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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread
* linux-next: manual merge of the rust tree with the origin tree
@ 2026-04-03 12:35 Mark Brown
  2026-04-03 12:53 ` Miguel Ojeda
  0 siblings, 1 reply; 14+ messages in thread
From: Mark Brown @ 2026-04-03 12:35 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Danilo Krummrich, Gary Guo, John Hubbard,
	Linux Kernel Mailing List, Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2934 bytes --]

Hi all,

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

  rust/kernel/ptr.rs

between commit:

  08da98f18f4f9 ("rust: ptr: add `KnownSize` trait to support DST size info extraction")

from the origin tree and commit:

  0a51b384e0dec ("rust: ptr: add const_align_up()")

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 rust/kernel/ptr.rs
index bdc2d79ff6699,c7788656a1621..0000000000000
--- a/rust/kernel/ptr.rs
+++ b/rust/kernel/ptr.rs
@@@ -2,15 -2,11 +2,17 @@@
  
  //! Types and functions to work with pointers and addresses.
  
 -use core::mem::align_of;
 +pub mod projection;
 +pub use crate::project_pointer as project;
 +
 +use core::mem::{
 +    align_of,
 +    size_of, //
 +};
  use core::num::NonZero;
  
+ use crate::const_assert;
+ 
  /// Type representing an alignment, which is always a power of two.
  ///
  /// It is used to validate that a given value is a valid alignment, and to perform masking and
@@@ -232,24 -226,31 +232,53 @@@ macro_rules! impl_alignable_uint 
  
  impl_alignable_uint!(u8, u16, u32, u64, usize);
  
 +/// Trait to represent compile-time known size information.
 +///
 +/// This is a generalization of [`size_of`] that works for dynamically sized types.
 +pub trait KnownSize {
 +    /// Get the size of an object of this type in bytes, with the metadata of the given pointer.
 +    fn size(p: *const Self) -> usize;
 +}
 +
 +impl<T> KnownSize for T {
 +    #[inline(always)]
 +    fn size(_: *const Self) -> usize {
 +        size_of::<T>()
 +    }
 +}
 +
 +impl<T> KnownSize for [T] {
 +    #[inline(always)]
 +    fn size(p: *const Self) -> usize {
 +        p.len() * size_of::<T>()
 +    }
 +}
++
+ /// Aligns `value` up to `align`.
+ ///
+ /// This is the const-compatible equivalent of [`Alignable::align_up`].
+ ///
+ /// Returns [`None`] on overflow.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use kernel::{
+ ///     ptr::{
+ ///         const_align_up,
+ ///         Alignment, //
+ ///     },
+ ///     sizes::SZ_4K, //
+ /// };
+ ///
+ /// assert_eq!(const_align_up(0x4f, Alignment::new::<16>()), Some(0x50));
+ /// assert_eq!(const_align_up(0x40, Alignment::new::<16>()), Some(0x40));
+ /// assert_eq!(const_align_up(1, Alignment::new::<SZ_4K>()), Some(SZ_4K));
+ /// ```
+ #[inline(always)]
+ pub const fn const_align_up(value: usize, align: Alignment) -> Option<usize> {
+     match value.checked_add(align.as_usize() - 1) {
+         Some(v) => Some(v & align.mask()),
+         None => None,
+     }
+ }

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread
* linux-next: manual merge of the rust tree with the origin tree
@ 2026-03-30 13:17 Mark Brown
  2026-03-30 13:26 ` Gary Guo
  0 siblings, 1 reply; 14+ messages in thread
From: Mark Brown @ 2026-03-30 13:17 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Danilo Krummrich, Gary Guo, Linux Kernel Mailing List,
	Linux Next Mailing List

[-- Attachment #1: Type: text/plain, Size: 2036 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 14+ messages in thread
* linux-next: manual merge of the rust tree with the origin tree
@ 2021-12-13 22:33 broonie
  0 siblings, 0 replies; 14+ messages in thread
From: broonie @ 2021-12-13 22:33 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Alex Gaynor, Boqun Feng, Gary Guo, Linux Kernel Mailing List,
	Linux Next Mailing List, Miguel Ojeda, Sasha Levin,
	Wedson Almeida Filho

Hi all,

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

  tools/include/linux/lockdep.h

between commit:

  3a49cc22d31ec ("tools/lib/lockdep: drop leftover liblockdep headers")

from the origin tree and commit:

  ab4cc3d9c564d ("kallsyms: increase maximum kernel symbol length to 512")

from the rust tree.

I fixed it up by removing lockdep.h again 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.

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-04-06 13:16 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-06 13:02 linux-next: manual merge of the rust tree with the origin tree Mark Brown
2026-04-06 13:11 ` Miguel Ojeda
2026-04-06 13:14   ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2026-04-06 13:13 Mark Brown
2026-04-06 13:16 ` Miguel Ojeda
2026-04-06 13:12 Mark Brown
2026-04-06 13:15 ` Miguel Ojeda
2026-04-03 12:35 Mark Brown
2026-04-03 12:53 ` Miguel Ojeda
2026-03-30 13:17 Mark Brown
2026-03-30 13:26 ` Gary Guo
2026-03-30 13:30   ` Miguel Ojeda
2026-03-30 13:32     ` Miguel Ojeda
2021-12-13 22:33 broonie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox