diff --git a/apple-silicon-support/packages/linux-asahi/default.nix b/apple-silicon-support/packages/linux-asahi/default.nix index f3df7086..86c3497d 100644 --- a/apple-silicon-support/packages/linux-asahi/default.nix +++ b/apple-silicon-support/packages/linux-asahi/default.nix @@ -98,11 +98,6 @@ let { name = "default-pagesize-16k"; patch = ./default-pagesize-16k.patch; } - ] ++ lib.optionals (rustOlder "1.66.0") [ - { name = "rust-1.66.0"; - patch = ./rust_1_66_0.patch; - reverse = true; - } ] ++ lib.optionals (bindgenAtLeast "0.63.0") [ { name = "rust-bindgen"; patch = ./rust-bindgen-0.63-fix.patch; @@ -111,16 +106,6 @@ let { name = "rust-bindgen"; patch = ./rust-bindgen-0.65-fix.patch; } - ] ++ lib.optionals (rustOlder "1.67.0") [ - { name = "rust-1.67.0"; - patch = ./rust_1_67_0.patch; - reverse = true; - } - ] ++ lib.optionals (rustOlder "1.71.0") [ - { name = "rust-1.71.0"; - patch = ./rust_1_71_0.patch; - reverse = true; - } ] ++ _kernelPatches; inherit configfile config; diff --git a/apple-silicon-support/packages/linux-asahi/rust_1_66_0.patch b/apple-silicon-support/packages/linux-asahi/rust_1_66_0.patch deleted file mode 100644 index 92423622..00000000 --- a/apple-silicon-support/packages/linux-asahi/rust_1_66_0.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/rust/alloc/alloc.rs b/rust/alloc/alloc.rs -index ca224a541..dac9e96d3 100644 ---- a/rust/alloc/alloc.rs -+++ b/rust/alloc/alloc.rs -@@ -30,13 +30,13 @@ extern "Rust" { - // The rustc fork of LLVM also special-cases these function names to be able to optimize them - // like `malloc`, `realloc`, and `free`, respectively. - #[rustc_allocator] -- #[rustc_allocator_nounwind] -+ #[rustc_nounwind] - fn __rust_alloc(size: usize, align: usize) -> *mut u8; -- #[rustc_allocator_nounwind] -+ #[rustc_nounwind] - fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize); -- #[rustc_allocator_nounwind] -+ #[rustc_nounwind] - fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8; -- #[rustc_allocator_nounwind] -+ #[rustc_nounwind] - fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8; - } - -diff --git a/rust/alloc/boxed.rs b/rust/alloc/boxed.rs -index 8fd296421..fa72125e8 100644 ---- a/rust/alloc/boxed.rs -+++ b/rust/alloc/boxed.rs -@@ -1972,7 +1972,7 @@ impl AsMut for Box { - */ - #[stable(feature = "pin", since = "1.33.0")] - #[rustc_const_unstable(feature = "const_box", issue = "92521")] --impl const Unpin for Box where A: 'static {} -+impl Unpin for Box where A: 'static {} - - #[unstable(feature = "generator_trait", issue = "43122")] - impl + Unpin, R, A: Allocator> Generator for Box -diff --git a/rust/kernel/driver.rs b/rust/kernel/driver.rs -index 7154c0221..af42a7732 100644 ---- a/rust/kernel/driver.rs -+++ b/rust/kernel/driver.rs -@@ -119,6 +119,7 @@ impl Drop for Registration { - /// - [`RawDeviceId::ZERO`] is actually a zeroed-out version of the raw device id. - /// - [`RawDeviceId::to_rawid`] stores `offset` in the context/data field of the raw device id so - /// that buses can recover the pointer to the data. -+#[const_trait] - pub unsafe trait RawDeviceId { - /// The raw type that holds the device id. - /// diff --git a/apple-silicon-support/packages/linux-asahi/rust_1_67_0.patch b/apple-silicon-support/packages/linux-asahi/rust_1_67_0.patch deleted file mode 100644 index daf92303..00000000 --- a/apple-silicon-support/packages/linux-asahi/rust_1_67_0.patch +++ /dev/null @@ -1,42 +0,0 @@ -diff --git a/rust/alloc/boxed.rs b/rust/alloc/boxed.rs -index 8fd296421dec..ee152abc3e24 100644 ---- a/rust/alloc/boxed.rs -+++ b/rust/alloc/boxed.rs -@@ -1867,7 +1867,7 @@ impl ExactSizeIterator for Box FusedIterator for Box {} - - #[stable(feature = "boxed_closure_impls", since = "1.35.0")] --impl + ?Sized, A: Allocator> FnOnce for Box { -+impl + ?Sized, A: Allocator> FnOnce for Box { - type Output = >::Output; - - extern "rust-call" fn call_once(self, args: Args) -> Self::Output { -@@ -1876,14 +1876,14 @@ impl + ?Sized, A: Allocator> FnOnce for Box { - } - - #[stable(feature = "boxed_closure_impls", since = "1.35.0")] --impl + ?Sized, A: Allocator> FnMut for Box { -+impl + ?Sized, A: Allocator> FnMut for Box { - extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output { - >::call_mut(self, args) - } - } - - #[stable(feature = "boxed_closure_impls", since = "1.35.0")] --impl + ?Sized, A: Allocator> Fn for Box { -+impl + ?Sized, A: Allocator> Fn for Box { - extern "rust-call" fn call(&self, args: Args) -> Self::Output { - >::call(self, args) - } -diff --git a/rust/alloc/lib.rs b/rust/alloc/lib.rs -index 03d2ce1df814..c7b20c65d224 100644 ---- a/rust/alloc/lib.rs -+++ b/rust/alloc/lib.rs -@@ -141,6 +141,7 @@ - #![feature(trusted_len)] - #![feature(trusted_random_access)] - #![feature(try_trait_v2)] -+#![feature(tuple_trait)] - #![feature(unchecked_math)] - #![feature(unicode_internals)] - #![feature(unsize)] diff --git a/apple-silicon-support/packages/linux-asahi/rust_1_71_0.patch b/apple-silicon-support/packages/linux-asahi/rust_1_71_0.patch deleted file mode 100644 index 11f9aab3..00000000 --- a/apple-silicon-support/packages/linux-asahi/rust_1_71_0.patch +++ /dev/null @@ -1,384 +0,0 @@ -diff --git a/rust/Makefile b/rust/Makefile -index e27f5d90843688..ce472b2113c851 100644 ---- a/rust/Makefile -+++ b/rust/Makefile -@@ -396,8 +396,8 @@ rust-analyzer: - $(RUST_LIB_SRC) > $(objtree)/rust-project.json - - redirect-intrinsics = \ -- __eqsf2 __gesf2 __lesf2 __nesf2 __unordsf2 \ -- __unorddf2 \ -+ __addsf3 __eqsf2 __gesf2 __lesf2 __ltsf2 __mulsf3 __nesf2 __unordsf2 \ -+ __adddf3 __ledf2 __ltdf2 __muldf3 __unorddf2 \ - __muloti4 __multi3 \ - __udivmodti4 __udivti3 __umodti3 \ - __aeabi_fcmpeq __aeabi_fcmpun __aeabi_dcmpun __aeabi_uldivmod -diff --git a/rust/compiler_builtins.rs b/rust/compiler_builtins.rs -index 565a583db7ad75..fd2fcaeca0b43d 100644 ---- a/rust/compiler_builtins.rs -+++ b/rust/compiler_builtins.rs -@@ -37,14 +37,21 @@ macro_rules! define_panicking_intrinsics( - ); - - define_panicking_intrinsics!("`f32` should not be used", { -+ __addsf3, - __eqsf2, - __gesf2, - __lesf2, -+ __ltsf2, -+ __mulsf3, - __nesf2, - __unordsf2, - }); - - define_panicking_intrinsics!("`f64` should not be used", { -+ __adddf3, -+ __ledf2, -+ __ltdf2, -+ __muldf3, - __unorddf2, - }); - -diff --git a/rust/alloc/alloc.rs b/rust/alloc/alloc.rs -index 0142178370e9..15596f01df25 100644 ---- a/rust/alloc/alloc.rs -+++ b/rust/alloc/alloc.rs -@@ -337,16 +337,12 @@ unsafe fn exchange_malloc(size: usize, align: usize) -> *mut u8 { - - #[cfg_attr(not(test), lang = "box_free")] - #[inline] --#[rustc_const_unstable(feature = "const_box", issue = "92521")] - // This signature has to be the same as `Box`, otherwise an ICE will happen. - // When an additional parameter to `Box` is added (like `A: Allocator`), this has to be added here as - // well. - // For example if `Box` is changed to `struct Box(Unique, A)`, - // this function has to be changed to `fn box_free(Unique, A)` as well. --pub(crate) const unsafe fn box_free( -- ptr: Unique, -- alloc: A, --) { -+pub(crate) unsafe fn box_free(ptr: Unique, alloc: A) { - unsafe { - let size = size_of_val(ptr.as_ref()); - let align = min_align_of_val(ptr.as_ref()); -diff --git a/rust/alloc/boxed.rs b/rust/alloc/boxed.rs -index d4a03edd7d89..5c1bd717f494 100644 ---- a/rust/alloc/boxed.rs -+++ b/rust/alloc/boxed.rs -@@ -380,12 +380,11 @@ impl Box { - /// ``` - #[cfg(not(no_global_oom_handling))] - #[unstable(feature = "allocator_api", issue = "32838")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[must_use] - #[inline] -- pub const fn new_in(x: T, alloc: A) -> Self -+ pub fn new_in(x: T, alloc: A) -> Self - where -- A: ~const Allocator + ~const Destruct, -+ A: Allocator - { - let mut boxed = Self::new_uninit_in(alloc); - unsafe { -@@ -410,12 +409,10 @@ impl Box { - /// # Ok::<(), std::alloc::AllocError>(()) - /// ``` - #[unstable(feature = "allocator_api", issue = "32838")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[inline] -- pub const fn try_new_in(x: T, alloc: A) -> Result -+ pub fn try_new_in(x: T, alloc: A) -> Result - where -- T: ~const Destruct, -- A: ~const Allocator + ~const Destruct, -+ A: Allocator - { - let mut boxed = Self::try_new_uninit_in(alloc)?; - unsafe { -@@ -445,13 +442,12 @@ impl Box { - /// assert_eq!(*five, 5) - /// ``` - #[unstable(feature = "allocator_api", issue = "32838")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[cfg(not(no_global_oom_handling))] - #[must_use] - // #[unstable(feature = "new_uninit", issue = "63291")] -- pub const fn new_uninit_in(alloc: A) -> Box, A> -+ pub fn new_uninit_in(alloc: A) -> Box, A> - where -- A: ~const Allocator + ~const Destruct, -+ A: Allocator - { - let layout = Layout::new::>(); - // NOTE: Prefer match over unwrap_or_else since closure sometimes not inlineable. -@@ -486,10 +482,9 @@ impl Box { - /// ``` - #[unstable(feature = "allocator_api", issue = "32838")] - // #[unstable(feature = "new_uninit", issue = "63291")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] -- pub const fn try_new_uninit_in(alloc: A) -> Result, A>, AllocError> -+ pub fn try_new_uninit_in(alloc: A) -> Result, A>, AllocError> - where -- A: ~const Allocator + ~const Destruct, -+ A: Allocator - { - let layout = Layout::new::>(); - let ptr = alloc.allocate(layout)?.cast(); -@@ -517,13 +512,12 @@ impl Box { - /// - /// [zeroed]: mem::MaybeUninit::zeroed - #[unstable(feature = "allocator_api", issue = "32838")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[cfg(not(no_global_oom_handling))] - // #[unstable(feature = "new_uninit", issue = "63291")] - #[must_use] -- pub const fn new_zeroed_in(alloc: A) -> Box, A> -+ pub fn new_zeroed_in(alloc: A) -> Box, A> - where -- A: ~const Allocator + ~const Destruct, -+ A: Allocator - { - let layout = Layout::new::>(); - // NOTE: Prefer match over unwrap_or_else since closure sometimes not inlineable. -@@ -558,10 +552,9 @@ impl Box { - /// [zeroed]: mem::MaybeUninit::zeroed - #[unstable(feature = "allocator_api", issue = "32838")] - // #[unstable(feature = "new_uninit", issue = "63291")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] -- pub const fn try_new_zeroed_in(alloc: A) -> Result, A>, AllocError> -+ pub fn try_new_zeroed_in(alloc: A) -> Result, A>, AllocError> - where -- A: ~const Allocator + ~const Destruct, -+ A: Allocator - { - let layout = Layout::new::>(); - let ptr = alloc.allocate_zeroed(layout)?.cast(); -@@ -577,12 +570,11 @@ impl Box { - /// construct a (pinned) `Box` in a different way than with [`Box::new_in`]. - #[cfg(not(no_global_oom_handling))] - #[unstable(feature = "allocator_api", issue = "32838")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[must_use] - #[inline(always)] -- pub const fn pin_in(x: T, alloc: A) -> Pin -+ pub fn pin_in(x: T, alloc: A) -> Pin - where -- A: 'static + ~const Allocator + ~const Destruct, -+ A: 'static + Allocator - { - Self::into_pin(Self::new_in(x, alloc)) - } -@@ -591,8 +583,7 @@ impl Box { - /// - /// This conversion does not allocate on the heap and happens in place. - #[unstable(feature = "box_into_boxed_slice", issue = "71582")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] -- pub const fn into_boxed_slice(boxed: Self) -> Box<[T], A> { -+ pub fn into_boxed_slice(boxed: Self) -> Box<[T], A> { - let (raw, alloc) = Box::into_raw_with_allocator(boxed); - unsafe { Box::from_raw_in(raw as *mut [T; 1], alloc) } - } -@@ -609,12 +600,8 @@ impl Box { - /// assert_eq!(Box::into_inner(c), 5); - /// ``` - #[unstable(feature = "box_into_inner", issue = "80437")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[inline] -- pub const fn into_inner(boxed: Self) -> T -- where -- Self: ~const Destruct, -- { -+ pub fn into_inner(boxed: Self) -> T { - *boxed - } - } -@@ -828,9 +815,8 @@ impl Box, A> { - /// assert_eq!(*five, 5) - /// ``` - #[unstable(feature = "new_uninit", issue = "63291")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[inline] -- pub const unsafe fn assume_init(self) -> Box { -+ pub unsafe fn assume_init(self) -> Box { - let (raw, alloc) = Box::into_raw_with_allocator(self); - unsafe { Box::from_raw_in(raw as *mut T, alloc) } - } -@@ -863,9 +849,8 @@ impl Box, A> { - /// } - /// ``` - #[unstable(feature = "new_uninit", issue = "63291")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[inline] -- pub const fn write(mut boxed: Self, value: T) -> Box { -+ pub fn write(mut boxed: Self, value: T) -> Box { - unsafe { - (*boxed).write(value); - boxed.assume_init() -@@ -1109,9 +1094,8 @@ impl Box { - /// - /// [memory layout]: self#memory-layout - #[unstable(feature = "allocator_api", issue = "32838")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[inline] -- pub const fn into_raw_with_allocator(b: Self) -> (*mut T, A) { -+ pub fn into_raw_with_allocator(b: Self) -> (*mut T, A) { - let (leaked, alloc) = Box::into_unique(b); - (leaked.as_ptr(), alloc) - } -@@ -1121,10 +1105,9 @@ impl Box { - issue = "none", - reason = "use `Box::leak(b).into()` or `Unique::from(Box::leak(b))` instead" - )] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[inline] - #[doc(hidden)] -- pub const fn into_unique(b: Self) -> (Unique, A) { -+ pub fn into_unique(b: Self) -> (Unique, A) { - // Box is recognized as a "unique pointer" by Stacked Borrows, but internally it is a - // raw pointer for the type system. Turning it directly into a raw pointer would not be - // recognized as "releasing" the unique pointer to permit aliased raw accesses, -@@ -1140,9 +1123,8 @@ impl Box { - /// to call it as `Box::allocator(&b)` instead of `b.allocator()`. This - /// is so that there is no conflict with a method on the inner type. - #[unstable(feature = "allocator_api", issue = "32838")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[inline] -- pub const fn allocator(b: &Self) -> &A { -+ pub fn allocator(b: &Self) -> &A { - &b.1 - } - -@@ -1182,9 +1164,8 @@ impl Box { - /// assert_eq!(*static_ref, [4, 2, 3]); - /// ``` - #[stable(feature = "box_leak", since = "1.26.0")] -- #[rustc_const_unstable(feature = "const_box", issue = "92521")] - #[inline] -- pub const fn leak<'a>(b: Self) -> &'a mut T -+ pub fn leak<'a>(b: Self) -> &'a mut T - where - A: 'a, - { -@@ -1460,8 +1441,7 @@ impl From for Box { - } - - #[stable(feature = "pin", since = "1.33.0")] --#[rustc_const_unstable(feature = "const_box", issue = "92521")] --impl const From> for Pin> -+impl From> for Pin> - where - A: 'static, - { -@@ -1898,8 +1878,7 @@ impl fmt::Pointer for Box { - } - - #[stable(feature = "rust1", since = "1.0.0")] --#[rustc_const_unstable(feature = "const_box", issue = "92521")] --impl const Deref for Box { -+impl Deref for Box { - type Target = T; - - fn deref(&self) -> &T { -@@ -1908,8 +1887,7 @@ impl const Deref for Box { - } - - #[stable(feature = "rust1", since = "1.0.0")] --#[rustc_const_unstable(feature = "const_box", issue = "92521")] --impl const DerefMut for Box { -+impl DerefMut for Box { - fn deref_mut(&mut self) -> &mut T { - &mut **self - } -diff --git a/rust/alloc/lib.rs b/rust/alloc/lib.rs -index 98b6dae4ec6c..d06023a167f2 100644 ---- a/rust/alloc/lib.rs -+++ b/rust/alloc/lib.rs -@@ -103,7 +103,6 @@ - #![feature(const_box)] - #![cfg_attr(not(no_global_oom_handling), feature(const_btree_len))] - #![cfg_attr(not(no_borrow), feature(const_cow_is_borrowed))] --#![feature(const_convert)] - #![feature(const_size_of_val)] - #![feature(const_align_of_val)] - #![feature(const_ptr_read)] -@@ -164,7 +163,6 @@ - #![feature(allow_internal_unstable)] - #![feature(associated_type_bounds)] - #![feature(cfg_sanitize)] --#![feature(const_deref)] - #![feature(const_mut_refs)] - #![feature(const_ptr_write)] - #![feature(const_precise_live_drops)] -diff --git a/rust/alloc/vec/mod.rs b/rust/alloc/vec/mod.rs -index 3308724352cc..2ad2c11ec2af 100644 ---- a/rust/alloc/vec/mod.rs -+++ b/rust/alloc/vec/mod.rs -@@ -3300,8 +3300,7 @@ unsafe impl<#[may_dangle] T, A: Allocator> Drop for Vec { - } - - #[stable(feature = "rust1", since = "1.0.0")] --#[rustc_const_unstable(feature = "const_default_impls", issue = "87864")] --impl const Default for Vec { -+impl Default for Vec { - /// Creates an empty `Vec`. - /// - /// The vector will not allocate until elements are pushed onto it. -diff --git a/rust/kernel/allocator.rs b/rust/kernel/allocator.rs -index 397a3dd57a9b..cfb406e2a710 100644 ---- a/rust/kernel/allocator.rs -+++ b/rust/kernel/allocator.rs -@@ -26,39 +26,6 @@ unsafe impl GlobalAlloc for KernelAllocator { - #[global_allocator] - static ALLOCATOR: KernelAllocator = KernelAllocator; - --// `rustc` only generates these for some crate types. Even then, we would need --// to extract the object file that has them from the archive. For the moment, --// let's generate them ourselves instead. --// --// Note that `#[no_mangle]` implies exported too, nowadays. -+// See . - #[no_mangle] --fn __rust_alloc(size: usize, _align: usize) -> *mut u8 { -- unsafe { bindings::krealloc(core::ptr::null(), size, bindings::GFP_KERNEL) as *mut u8 } --} -- --#[no_mangle] --fn __rust_dealloc(ptr: *mut u8, _size: usize, _align: usize) { -- unsafe { bindings::kfree(ptr as *const core::ffi::c_void) }; --} -- --#[no_mangle] --fn __rust_realloc(ptr: *mut u8, _old_size: usize, _align: usize, new_size: usize) -> *mut u8 { -- unsafe { -- bindings::krealloc( -- ptr as *const core::ffi::c_void, -- new_size, -- bindings::GFP_KERNEL, -- ) as *mut u8 -- } --} -- --#[no_mangle] --fn __rust_alloc_zeroed(size: usize, _align: usize) -> *mut u8 { -- unsafe { -- bindings::krealloc( -- core::ptr::null(), -- size, -- bindings::GFP_KERNEL | bindings::__GFP_ZERO, -- ) as *mut u8 -- } --} -+static __rust_no_alloc_shim_is_unstable: u8 = 0; -diff --git a/rust/kernel/driver.rs b/rust/kernel/driver.rs -index aa1441ae809b..e59f163d8ff3 100644 ---- a/rust/kernel/driver.rs -+++ b/rust/kernel/driver.rs -@@ -221,7 +221,7 @@ pub struct IdTable<'a, T: RawDeviceId, U> { - _p: PhantomData<&'a U>, - } - --impl const AsRef for IdTable<'_, T, U> { -+impl AsRef for IdTable<'_, T, U> { - fn as_ref(&self) -> &T::RawType { - self.first - }