Skip to content

Commit

Permalink
fix(core): adapt to the change in guaranteed_eq's return type
Browse files Browse the repository at this point in the history
This change has occurred in [rust-lang/rust#101483][1].

[1]: rust-lang/rust#101483
  • Loading branch information
yvt committed Nov 9, 2022
1 parent ee14441 commit 04223bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/r3_core/src/closure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ impl Closure {
} else {
let env = core::intrinsics::const_allocate(size, align);
assert!(
!env.guaranteed_eq(core::ptr::null_mut()),
!env.guaranteed_eq(core::ptr::null_mut()).unwrap_or(false),
"heap allocation failed"
);
env.cast::<T>().write(func);
Expand Down
2 changes: 1 addition & 1 deletion src/r3_core/src/utils/freeze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl<T: Copy> Frozen<T> {
// Allocate a CTFE heap memory block
let ptr = core::intrinsics::const_allocate(size, align).cast::<T>();
assert!(
!ptr.guaranteed_eq(core::ptr::null_mut()),
!ptr.guaranteed_eq(core::ptr::null_mut()).unwrap_or(false),
"heap allocation failed"
);

Expand Down

0 comments on commit 04223bf

Please sign in to comment.