We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6eaf531 commit 58dcd1cCopy full SHA for 58dcd1c
compiler/rustc_middle/src/lib.rs
@@ -34,6 +34,7 @@
34
#![feature(allocator_api)]
35
#![feature(array_windows)]
36
#![feature(assert_matches)]
37
+#![feature(box_as_ptr)]
38
#![feature(box_patterns)]
39
#![feature(closure_track_caller)]
40
#![feature(const_option)]
compiler/rustc_middle/src/mir/interpret/allocation.rs
@@ -62,13 +62,11 @@ impl AllocBytes for Box<[u8]> {
62
}
63
64
fn as_mut_ptr(&mut self) -> *mut u8 {
65
- // Carefully avoiding any intermediate references.
66
- ptr::addr_of_mut!(**self).cast()
+ Box::as_mut_ptr(self).cast()
67
68
69
fn as_ptr(&self) -> *const u8 {
70
71
- ptr::addr_of!(**self).cast()
+ Box::as_ptr(self).cast()
72
73
74
0 commit comments