mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
use the new Box methods in the interpreter
This commit is contained in:
parent
6eaf531432
commit
58dcd1c2e6
@ -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)]
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user