From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mx.groups.io with SMTP id smtpd.web10.4758.1647673581962030176 for ; Sat, 19 Mar 2022 00:06:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=BMjiyLwq; spf=pass (domain: gmail.com, ip: 209.85.215.170, mailfrom: ayushdevel1325@gmail.com) Received: by mail-pg1-f170.google.com with SMTP id e6so6585153pgn.2 for ; Sat, 19 Mar 2022 00:06:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uWfjxT5ux7s+brAlebqXX5t7pyZ7bTqHDRqPYarX7jQ=; b=BMjiyLwqKAVj4buuXoWzt5sU/WljLrLPQuvZVbhDtDVNsHiMDapCm192LdMTUozC7j NCPvIE50q4+Q0JWMmzrxz2iqvCw0wYbsm5qnMbeHLktgoowniiOk7g+1gWKzsqNjLzqY M2MjLOxKUv1MAAGdQobuELoa8qgSrrpK5HamuzLh7ReqdmFS9wRK0aNVPv9IfXViE2lx XO1nXJ1jP76SqAjjnGX/MnRqF7hijRNdpqTxLLJyzo+FMVFkMfoeAa8TEb4DsrmU81h8 hujGDOzZgD9l7t2Nxfa7LOMvg7NbE/n8DHAKTG8NqhMOkqunxaVJD63H5NgTJy5lr9gy 0iBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uWfjxT5ux7s+brAlebqXX5t7pyZ7bTqHDRqPYarX7jQ=; b=KtC5eufUuwSd9oxXuceNv20g0xRdryNknsFkClG+NIVZSTdHajq6L0g5oiwQrjN4cW u3i8P2LNmR1/icbjmIVwhqaKhNTKpxwGizBV+xsg+KXQID4mnk41Wl7Lgj+8glcdai95 X82KgmcyF+7BuGtsausl1GoF7rZFFbaQtVYDSoGWaQYjSFsg6vYjKnnP5r5pjgglCbMd qG/kLQ/HZ+62RhWA7RRBBKhy3tdGyfBUgEUzHopnK33V6lDOpbd52dzu+ZNDQsL635yv Ys77niBAd2BLb3AGhoSKwS3kXUEWC0v+AcpsGoQv3O+gyaPlXlT8qhM3QanZqQgejD7F F+fg== X-Gm-Message-State: AOAM530CNxp+cMORUa1oWmB59AH7Wym4dGFCfttCWEIPVmPdKJeVQCxr XAbdzXfDjfM+e7yfgnby08wv6XbEv++4yg== X-Google-Smtp-Source: ABdhPJxjdmcaD+vEi1vzpLdHdSvAs1EYP8T4NPZJfA9iaW7GYrImpy4yrfrI1YJcsd2FW0PHitu4hg== X-Received: by 2002:aa7:88d5:0:b0:4f7:7fbd:c653 with SMTP id k21-20020aa788d5000000b004f77fbdc653mr14173531pff.41.1647673580481; Sat, 19 Mar 2022 00:06:20 -0700 (PDT) Return-Path: Received: from toolbox.iitism.net ([103.15.228.66]) by smtp.gmail.com with ESMTPSA id u4-20020a056a00158400b004fa0263cf5dsm12300538pfk.130.2022.03.19.00.06.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Mar 2022 00:06:19 -0700 (PDT) From: "Ayush Singh" To: devel@edk2.groups.io Cc: Jiewen Yao Subject: [PATCH v1 2/3] RustPkg/Test/TestRustLangLib: Fix Building Date: Sat, 19 Mar 2022 12:35:52 +0530 Message-Id: <20220319070553.25770-3-ayushdevel1325@gmail.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220319070553.25770-1-ayushdevel1325@gmail.com> References: <20220319070553.25770-1-ayushdevel1325@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ayush Singh Removed the Alloc trait usage which seems to have been removed from Rust now. Cc: Jiewen Yao Signed-off-by: Ayush Singh --- RustPkg/Library/UefiRustAllocationLib/src/lib.rs | 53 ++-- RustPkg/Test/TestRustLangLib/.cargo/config.toml | 3 + RustPkg/Test/TestRustLangLib/src/lib.rs | 264 ++++++++------------ 3 files changed, 137 insertions(+), 183 deletions(-) diff --git a/RustPkg/Library/UefiRustAllocationLib/src/lib.rs b/RustPkg/Lib= rary/UefiRustAllocationLib/src/lib.rs index f369e1bb170b..6a65f0a5f988 100644 --- a/RustPkg/Library/UefiRustAllocationLib/src/lib.rs +++ b/RustPkg/Library/UefiRustAllocationLib/src/lib.rs @@ -15,44 +15,42 @@ #![feature(alloc_layout_extra)]=0D #![feature(allocator_api)]=0D #![feature(alloc_error_handler)]=0D -=0D #![cfg_attr(not(test), no_std)]=0D -=0D #![allow(unused)]=0D =0D extern crate uefi_rust_panic_lib;=0D =0D -use core::alloc::{GlobalAlloc, Layout, Alloc};=0D -use r_efi::efi;=0D -use r_efi::efi::{Status};=0D +use core::alloc::{GlobalAlloc, Layout};=0D use core::ffi::c_void;=0D +use r_efi::efi;=0D +use r_efi::efi::Status;=0D =0D pub struct MyAllocator;=0D =0D -static mut ST : *mut efi::SystemTable =3D core::ptr::null_mut();=0D -static mut BS : *mut efi::BootServices =3D core::ptr::null_mut();=0D +static mut ST: *mut efi::SystemTable =3D core::ptr::null_mut();=0D +static mut BS: *mut efi::BootServices =3D core::ptr::null_mut();=0D =0D unsafe impl GlobalAlloc for MyAllocator {=0D unsafe fn alloc(&self, layout: Layout) -> *mut u8 {=0D - let size =3D layout.size();=0D - let align =3D layout.align();=0D - if align > 8 {=0D - return core::ptr::null_mut();=0D - }=0D + let size =3D layout.size();=0D + let align =3D layout.align();=0D + if align > 8 {=0D + return core::ptr::null_mut();=0D + }=0D =0D - let mut address : *mut c_void =3D core::ptr::null_mut();=0D - let status =3D ((*BS).allocate_pool) (=0D - efi::MemoryType::BootServicesData,=0D - size,=0D - &mut address as *mut *mut c_void=0D - );=0D - if status !=3D Status::SUCCESS {=0D - return core::ptr::null_mut();=0D - }=0D - address as *mut u8=0D + let mut address: *mut c_void =3D core::ptr::null_mut();=0D + let status =3D ((*BS).allocate_pool)(=0D + efi::MemoryType::BootServicesData,=0D + size,=0D + &mut address as *mut *mut c_void,=0D + );=0D + if status !=3D Status::SUCCESS {=0D + return core::ptr::null_mut();=0D + }=0D + address as *mut u8=0D }=0D unsafe fn dealloc(&self, ptr: *mut u8, _layout: Layout) {=0D - ((*BS).free_pool) (ptr as *mut c_void);=0D + ((*BS).free_pool)(ptr as *mut c_void);=0D }=0D }=0D =0D @@ -60,14 +58,13 @@ unsafe impl GlobalAlloc for MyAllocator { static ALLOCATOR: MyAllocator =3D MyAllocator;=0D =0D #[alloc_error_handler]=0D -fn alloc_error_handler(layout: core::alloc::Layout) -> !=0D -{=0D +fn alloc_error_handler(layout: core::alloc::Layout) -> ! {=0D loop {}=0D }=0D =0D -pub extern fn init(system_table: *mut efi::SystemTable) {=0D +pub extern "C" fn init(system_table: *mut efi::SystemTable) {=0D unsafe {=0D - ST =3D system_table;=0D - BS =3D (*ST).boot_services;=0D + ST =3D system_table;=0D + BS =3D (*ST).boot_services;=0D }=0D }=0D diff --git a/RustPkg/Test/TestRustLangLib/.cargo/config.toml b/RustPkg/Test= /TestRustLangLib/.cargo/config.toml new file mode 100644 index 000000000000..422bf9d2ab4e --- /dev/null +++ b/RustPkg/Test/TestRustLangLib/.cargo/config.toml @@ -0,0 +1,3 @@ +[unstable] +build-std =3D ["core", "compiler_builtins", "alloc"] +build-std-features =3D ["compiler-builtins-mem"] diff --git a/RustPkg/Test/TestRustLangLib/src/lib.rs b/RustPkg/Test/TestRus= tLangLib/src/lib.rs index ee3a0d7cc83e..888733232b71 100644 --- a/RustPkg/Test/TestRustLangLib/src/lib.rs +++ b/RustPkg/Test/TestRustLangLib/src/lib.rs @@ -14,24 +14,22 @@ =0D #![feature(alloc_layout_extra)]=0D #![feature(allocator_api)]=0D -#![feature(core_panic_info)]=0D -=0D +#![feature(slice_ptr_get)]=0D #![cfg_attr(not(test), no_std)]=0D -=0D #![allow(unused)]=0D =0D mod mem;=0D =0D use r_efi::efi;=0D -use r_efi::efi::{Status};=0D +use r_efi::efi::Status;=0D =0D -extern {=0D - fn AllocatePool (Size: usize) -> *mut c_void;=0D - fn FreePool (Buffer: *mut c_void);=0D +extern "C" {=0D + fn AllocatePool(Size: usize) -> *mut c_void;=0D + fn FreePool(Buffer: *mut c_void);=0D }=0D =0D -use core::panic::PanicInfo;=0D use core::ffi::c_void;=0D +use core::panic::PanicInfo;=0D =0D use core::mem::size_of;=0D use core::mem::transmute;=0D @@ -40,30 +38,22 @@ use core::slice; use core::slice::from_raw_parts;=0D use core::slice::from_raw_parts_mut;=0D =0D -extern crate uefi_rust_panic_lib;=0D extern crate uefi_rust_allocation_lib;=0D +extern crate uefi_rust_panic_lib;=0D =0D extern crate alloc;=0D =0D -use alloc::vec::Vec;=0D +use alloc::alloc::{handle_alloc_error, Allocator, Global, Layout};=0D use alloc::boxed::Box;=0D -use alloc::{=0D - alloc::{handle_alloc_error, Alloc, Global, Layout},=0D -};=0D -=0D +use alloc::vec::Vec;=0D =0D #[no_mangle]=0D #[export_name =3D "TestIntegerOverflow"]=0D -pub extern fn test_integer_overflow (=0D - buffer_size: usize,=0D - width : u32,=0D - height : u32,=0D - ) -> Status=0D -{=0D +pub extern "C" fn test_integer_overflow(buffer_size: usize, width: u32, he= ight: u32) -> Status {=0D let data_size =3D width * height * 4;=0D =0D if data_size as usize > buffer_size {=0D - return Status::UNSUPPORTED;=0D + return Status::UNSUPPORTED;=0D }=0D =0D Status::SUCCESS=0D @@ -71,26 +61,24 @@ pub extern fn test_integer_overflow ( =0D #[no_mangle]=0D #[export_name =3D "TestIntegerCheckedOverflow"]=0D -pub extern fn test_integer_checked_overflow (=0D +pub extern "C" fn test_integer_checked_overflow(=0D buffer_size: usize,=0D - width : u32,=0D - height : u32,=0D - ) -> Status=0D -{=0D -=0D + width: u32,=0D + height: u32,=0D +) -> Status {=0D let mut data_size: u32 =3D 0;=0D =0D match width.checked_mul(height) {=0D - Some(size) =3D> {data_size =3D size},=0D - None =3D> {return Status::INVALID_PARAMETER},=0D + Some(size) =3D> data_size =3D size,=0D + None =3D> return Status::INVALID_PARAMETER,=0D }=0D match data_size.checked_mul(4) {=0D - Some(size) =3D> {data_size =3D size},=0D - None =3D> {return Status::INVALID_PARAMETER},=0D + Some(size) =3D> data_size =3D size,=0D + None =3D> return Status::INVALID_PARAMETER,=0D }=0D =0D if data_size as usize > buffer_size {=0D - return Status::UNSUPPORTED;=0D + return Status::UNSUPPORTED;=0D }=0D =0D Status::SUCCESS=0D @@ -98,31 +86,27 @@ pub extern fn test_integer_checked_overflow ( =0D #[no_mangle]=0D #[export_name =3D "TestIntegerCast"]=0D -pub extern fn test_integer_cast (=0D - buffer_size: u64,=0D - ) -> u32=0D -{=0D - let data_size : u32 =3D buffer_size as u32;=0D +pub extern "C" fn test_integer_cast(buffer_size: u64) -> u32 {=0D + let data_size: u32 =3D buffer_size as u32;=0D data_size=0D }=0D =0D -extern {=0D - fn ExternInit(Data: *mut usize);=0D +extern "C" {=0D + fn ExternInit(Data: *mut usize);=0D }=0D =0D #[no_mangle]=0D #[export_name =3D "TestUninitializedVariable"]=0D -pub extern fn test_uninitializd_variable (=0D - index: usize,=0D - ) -> usize=0D -{=0D - let mut data : usize =3D 1;=0D +pub extern "C" fn test_uninitializd_variable(index: usize) -> usize {=0D + let mut data: usize =3D 1;=0D =0D if index > 10 {=0D - data =3D 0;=0D + data =3D 0;=0D }=0D =0D - unsafe { ExternInit (&mut data ); }=0D + unsafe {=0D + ExternInit(&mut data);=0D + }=0D =0D data =3D data + 1;=0D =0D @@ -131,11 +115,8 @@ pub extern fn test_uninitializd_variable ( =0D #[no_mangle]=0D #[export_name =3D "TestArrayOutOfRange"]=0D -pub extern fn test_array_out_of_range (=0D - index: usize,=0D - ) -> usize=0D -{=0D - let mut data : [u8; 8] =3D [0; 8];=0D +pub extern "C" fn test_array_out_of_range(index: usize) -> usize {=0D + let mut data: [u8; 8] =3D [0; 8];=0D =0D data[index] =3D 1;=0D =0D @@ -152,18 +133,21 @@ pub struct TestTable { =0D #[no_mangle]=0D #[export_name =3D "TestBufferOverflow"]=0D -pub extern fn test_buffer_overflow (=0D +pub extern "C" fn test_buffer_overflow(=0D buffer: &mut [u8; 0],=0D buffer_size: usize,=0D table: &TestTable,=0D table_size: usize,=0D - )=0D -{=0D - let mut dest =3D crate::mem::MemoryRegion::new(buffer as *mut [u8; 0] = as usize as u64, buffer_size as u64);=0D - let mut source =3D crate::mem::MemoryRegion::new(&table.value as *cons= t [u8; 0] as usize as u64, table_size as u64);=0D +) {=0D + let mut dest =3D=0D + crate::mem::MemoryRegion::new(buffer as *mut [u8; 0] as usize as u= 64, buffer_size as u64);=0D + let mut source =3D crate::mem::MemoryRegion::new(=0D + &table.value as *const [u8; 0] as usize as u64,=0D + table_size as u64,=0D + );=0D =0D - for index in 0_u64 .. table.length as u64 {=0D - dest.write_u8(index, source.read_u8(index));=0D + for index in 0_u64..table.length as u64 {=0D + dest.write_u8(index, source.read_u8(index));=0D }=0D }=0D =0D @@ -177,59 +161,49 @@ pub struct TestTableFixed { =0D #[no_mangle]=0D #[export_name =3D "TestBufferOverflowFixed"]=0D -pub extern fn test_buffer_overflow_fixed (=0D - buffer: &mut [u8; 32],=0D - table: &TestTableFixed,=0D - )=0D -{=0D - (*buffer)[0_usize..(table.length as usize)].copy_from_slice(=0D - &table.value[0_usize..(table.length as usize)]=0D - );=0D +pub extern "C" fn test_buffer_overflow_fixed(buffer: &mut [u8; 32], table:= &TestTableFixed) {=0D + (*buffer)[0_usize..(table.length as usize)]=0D + .copy_from_slice(&table.value[0_usize..(table.length as usize)]);= =0D }=0D =0D -fn get_buffer<'a> () -> Option<&'a mut TestTableFixed>=0D -{=0D - let ptr : *mut c_void =3D unsafe { AllocatePool (size_of::()) };=0D +fn get_buffer<'a>() -> Option<&'a mut TestTableFixed> {=0D + let ptr: *mut c_void =3D unsafe { AllocatePool(size_of::()) };=0D if ptr.is_null() {=0D - return None;=0D + return None;=0D }=0D - let buffer : &mut TestTableFixed =3D unsafe { core::mem::transmute::<*= mut c_void, &mut TestTableFixed>(ptr) };=0D + let buffer: &mut TestTableFixed =3D=0D + unsafe { core::mem::transmute::<*mut c_void, &mut TestTableFixed>(= ptr) };=0D Some(buffer)=0D }=0D =0D -fn release_buffer (test_table : &mut TestTableFixed)=0D -{=0D - test_table.r#type =3D 0;=0D - unsafe { FreePool (test_table as *mut TestTableFixed as *mut c_void) ; }= =0D +fn release_buffer(test_table: &mut TestTableFixed) {=0D + test_table.r#type =3D 0;=0D + unsafe {=0D + FreePool(test_table as *mut TestTableFixed as *mut c_void);=0D + }=0D }=0D =0D #[no_mangle]=0D #[export_name =3D "TestBufferDrop"]=0D -pub extern fn test_buffer_drop (=0D - =0D - )=0D -{=0D - match get_buffer () {=0D - Some(buffer) =3D> {=0D - buffer.r#type =3D 1;=0D - release_buffer(buffer);=0D - drop (buffer); // This is required.=0D - //buffer.r#type =3D 1; // error=0D - },=0D - None =3D> {},=0D +pub extern "C" fn test_buffer_drop() {=0D + match get_buffer() {=0D + Some(buffer) =3D> {=0D + buffer.r#type =3D 1;=0D + release_buffer(buffer);=0D + drop(buffer); // This is required.=0D + //buffer.r#type =3D 1; // error=0D + }=0D + None =3D> {}=0D }=0D }=0D =0D #[no_mangle]=0D #[export_name =3D "TestBufferBorrow"]=0D -pub extern fn test_buffer_borrow (=0D - test_table : &mut TestTableFixed=0D - )=0D -{=0D - let test_table2 : &mut TestTableFixed =3D test_table;=0D +pub extern "C" fn test_buffer_borrow(test_table: &mut TestTableFixed) {=0D + let test_table2: &mut TestTableFixed =3D test_table;=0D test_table2.r#type =3D 1;=0D =0D - let test_table3 : &mut [u8; 64] =3D &mut test_table.value;=0D + let test_table3: &mut [u8; 64] =3D &mut test_table.value;=0D test_table3[63] =3D 0;=0D =0D //test_table2.r#type =3D 2; // error=0D @@ -237,44 +211,38 @@ pub extern fn test_buffer_borrow ( =0D #[no_mangle]=0D #[export_name =3D "TestBufferAlloc"]=0D -pub extern fn test_buffer_alloc (=0D - =0D - )=0D -{=0D +pub extern "C" fn test_buffer_alloc() {=0D let layout =3D unsafe { core::alloc::Layout::from_size_align_unchecked= (32, 4) };=0D unsafe {=0D - match Global.alloc (layout) {=0D - Ok(buffer) =3D> {=0D - let mut box_buffer =3D Box::from_raw(from_raw_parts_mut(buffer.a= s_ptr(), layout.size()));=0D - box_buffer[0] =3D 1;=0D - Global.dealloc (buffer, layout);=0D - drop (buffer); // It is useless=0D - box_buffer[0] =3D 1; // cannot catch=0D - },=0D - Err(_) =3D> handle_alloc_error (layout),=0D - }=0D + match Global.allocate(layout) {=0D + Ok(mut buffer) =3D> {=0D + let mut box_buffer =3D Box::from_raw(buffer.as_mut());=0D + box_buffer[0] =3D 1;=0D + Global.deallocate(buffer.as_non_null_ptr(), layout);=0D + drop(buffer); // It is useless=0D + box_buffer[0] =3D 1; // cannot catch=0D + }=0D + Err(_) =3D> handle_alloc_error(layout),=0D + }=0D }=0D =0D let layout =3D core::alloc::Layout::new::();=0D unsafe {=0D - match Global.alloc (layout) {=0D - Ok(buffer) =3D> {=0D - Global.dealloc (buffer, layout);=0D - },=0D - Err(_) =3D> handle_alloc_error (layout),=0D - }=0D + match Global.allocate(layout) {=0D + Ok(buffer) =3D> {=0D + Global.deallocate(buffer.as_non_null_ptr(), layout);=0D + }=0D + Err(_) =3D> handle_alloc_error(layout),=0D + }=0D }=0D }=0D =0D -fn get_box (=0D - r#type: u32=0D - ) -> Box=0D -{=0D - let mut a =3D Box::new(TestTableFixed{=0D - r#type: 0,=0D - length: size_of::() as u32,=0D - value: [0; 64]=0D - }); // it will call __rust_alloc().=0D +fn get_box(r#type: u32) -> Box {=0D + let mut a =3D Box::new(TestTableFixed {=0D + r#type: 0,=0D + length: size_of::() as u32,=0D + value: [0; 64],=0D + }); // it will call __rust_alloc().=0D a.r#type =3D r#type;=0D =0D a=0D @@ -282,35 +250,26 @@ fn get_box ( =0D #[no_mangle]=0D #[export_name =3D "TestBoxAlloc"]=0D -pub extern fn test_box_alloc (=0D - r#type: u32=0D - ) -> Box=0D -{=0D - let mut a =3D get_box(1);=0D +pub extern "C" fn test_box_alloc(r#type: u32) -> Box {=0D + let mut a =3D get_box(1);=0D =0D - a.r#type =3D r#type;=0D + a.r#type =3D r#type;=0D =0D - //test_box_free(a); // build fail.=0D + //test_box_free(a); // build fail.=0D =0D - let b =3D a;=0D - b=0D + let b =3D a;=0D + b=0D }=0D =0D #[no_mangle]=0D #[export_name =3D "TestBoxFree"]=0D -pub extern fn test_box_free (=0D - buffer: Box=0D - )=0D -{=0D - // it will call __rust_dealloc()=0D +pub extern "C" fn test_box_free(buffer: Box) {=0D + // it will call __rust_dealloc()=0D }=0D =0D #[no_mangle]=0D #[export_name =3D "TestBoxAllocFail"]=0D -pub extern fn test_box_alloc_fail (=0D - size: u32=0D - ) -> Box<[u8; 0x800]>=0D -{=0D +pub extern "C" fn test_box_alloc_fail(size: u32) -> Box<[u8; 0x800]> {=0D let mut a =3D Box::new([0_u8; 0x800]); // it will call __rust_alloc().= =0D =0D a=0D @@ -318,22 +277,17 @@ pub extern fn test_box_alloc_fail ( =0D #[no_mangle]=0D #[export_name =3D "TestBoxConvert"]=0D -pub extern fn test_box_convert (=0D - size: usize=0D - ) -> *mut u8=0D -{=0D +pub extern "C" fn test_box_convert(size: usize) -> *mut u8 {=0D let layout =3D unsafe { core::alloc::Layout::from_size_align_unchecked= (size, 4) };=0D unsafe {=0D - match Global.alloc (layout) {=0D - Ok(buffer) =3D> {=0D - let mut box_buffer =3D Box::::from_raw(from_raw_parts_mut(bu= ffer.as_ptr(), layout.size()) as *mut [u8] as *mut u8 );=0D - Global.dealloc (buffer, layout);=0D - *box_buffer =3D 1;=0D - Box::::into_raw(box_buffer)=0D - },=0D - Err(_) =3D> handle_alloc_error (layout),=0D - }=0D + match Global.allocate(layout) {=0D + Ok(buffer) =3D> {=0D + let mut box_buffer =3D Box::::from_raw(buffer.as_mut_p= tr());=0D + Global.deallocate(buffer.as_non_null_ptr(), layout);=0D + *box_buffer =3D 1;=0D + Box::::into_raw(box_buffer)=0D + }=0D + Err(_) =3D> handle_alloc_error(layout),=0D + }=0D }=0D -=0D -=0D }=0D --=20 2.35.1