We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 778e235 commit e45bed2Copy full SHA for e45bed2
src/raw/mod.rs
@@ -57,14 +57,12 @@ use core::convert::identity as unlikely;
57
#[cfg(feature = "nightly")]
58
use core::intrinsics::{likely, unlikely};
59
60
-// Use strict provenance functions if available.
61
-#[cfg(feature = "nightly")]
62
-use core::ptr::invalid_mut;
63
-// Implement it with a cast otherwise.
+// FIXME: use strict provenance functions once they are stable.
+// Implement it with a transmute for now.
64
#[cfg(not(feature = "nightly"))]
65
#[inline(always)]
66
fn invalid_mut<T>(addr: usize) -> *mut T {
67
- addr as *mut T
+ unsafe { core::mem::transmute(addr) }
68
}
69
70
#[inline]
0 commit comments