Re: linux-next: manual merge of the rust tree with the driver-core tree

Stephen Rothwell
2025-01-23T03:28:38Z

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

Hi all,

On Tue, 14 Jan 2025 15:37:33 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the rust tree got a conflict in:
>
> rust/kernel/lib.rs
>
> between commit:
>
> 9b90864bb42b ("rust: implement `IdArray`, `IdTable` and `RawDeviceId`")
>
> from the driver-core tree and commit:
>
> 47cb6bf7860c ("rust: use derive(CoercePointee) on rustc >= 1.84.0")
>
> 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 b11fa08de3c0,545d1170ee63..000000000000
> --- a/rust/kernel/lib.rs
> +++ b/rust/kernel/lib.rs
> @@@ -13,16 -13,12 +13,17 @@@
>
> #![no_std]
> #![feature(arbitrary_self_types)]
> - #![feature(coerce_unsized)]
> - #![feature(dispatch_from_dyn)]
> + #![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_dyn))]
> + #![cfg_attr(not(CONFIG_RUSTC_HAS_COERCE_POINTEE), feature(unsize))]
> #![feature(inline_const)]
> #![feature(lint_reasons)]
> - #![feature(unsize)]
> +// Stable in Rust 1.83
> +#![feature(const_maybe_uninit_as_mut_ptr)]
> +#![feature(const_mut_refs)]
> +#![feature(const_ptr_write)]
> +#![feature(const_refs_to_cell)]
>
> // Ensure conditional compilation based on the kernel configuration works;
> // otherwise we may silently break things like initcall handling.
> @@@ -37,12 -33,10 +38,13 @@@ pub use ffi
> pub mod alloc;
> #[cfg(CONFIG_BLOCK)]
> pub mod block;
> - mod build_assert;
> + #[doc(hidden)]
> + pub mod build_assert;
> pub mod cred;
> pub mod device;
> +pub mod device_id;
> +pub mod devres;
> +pub mod driver;
> pub mod error;
> #[cfg(CONFIG_RUST_FW_LOADER_ABSTRACTIONS)]
> pub mod firmware;

This is now a conflict bewteen the driver-core tree and Linus' tree.