use the new Box methods in the interpreter

This commit is contained in:
Ralf Jung 2024-08-14 14:32:17 +02:00
parent 6eaf531432
commit 58dcd1c2e6
2 changed files with 3 additions and 4 deletions

View File

@ -34,6 +34,7 @@
#![feature(allocator_api)]
#![feature(array_windows)]
#![feature(assert_matches)]
#![feature(box_as_ptr)]
#![feature(box_patterns)]
#![feature(closure_track_caller)]
#![feature(const_option)]

View File

@ -62,13 +62,11 @@ impl AllocBytes for Box<[u8]> {
}
fn as_mut_ptr(&mut self) -> *mut u8 {
// Carefully avoiding any intermediate references.
ptr::addr_of_mut!(**self).cast()
Box::as_mut_ptr(self).cast()
}
fn as_ptr(&self) -> *const u8 {
// Carefully avoiding any intermediate references.
ptr::addr_of!(**self).cast()
Box::as_ptr(self).cast()
}
}