We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
guaranteed_eq
1 parent ee14441 commit 04223bfCopy full SHA for 04223bf
src/r3_core/src/closure.rs
@@ -138,7 +138,7 @@ impl Closure {
138
} else {
139
let env = core::intrinsics::const_allocate(size, align);
140
assert!(
141
- !env.guaranteed_eq(core::ptr::null_mut()),
+ !env.guaranteed_eq(core::ptr::null_mut()).unwrap_or(false),
142
"heap allocation failed"
143
);
144
env.cast::<T>().write(func);
src/r3_core/src/utils/freeze.rs
@@ -58,7 +58,7 @@ impl<T: Copy> Frozen<T> {
58
// Allocate a CTFE heap memory block
59
let ptr = core::intrinsics::const_allocate(size, align).cast::<T>();
60
61
- !ptr.guaranteed_eq(core::ptr::null_mut()),
+ !ptr.guaranteed_eq(core::ptr::null_mut()).unwrap_or(false),
62
63
64
0 commit comments