From 5d404a8d5ea70163b5b1078685b2afd448b20c32 Mon Sep 17 00:00:00 2001 From: wcampbell Date: Thu, 17 Mar 2022 23:14:18 -0400 Subject: [PATCH] fix: remove usage of HEAP mut ref in example Remove &mut and just use .as_ptr() as the function requires --- examples/global_alloc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/global_alloc.rs b/examples/global_alloc.rs index dcf42c5..9197794 100644 --- a/examples/global_alloc.rs +++ b/examples/global_alloc.rs @@ -20,7 +20,7 @@ fn main() -> ! { use core::mem::MaybeUninit; const HEAP_SIZE: usize = 1024; static mut HEAP: [MaybeUninit; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE]; - unsafe { ALLOCATOR.init((&mut HEAP).as_ptr() as usize, HEAP_SIZE) } + unsafe { ALLOCATOR.init(HEAP.as_ptr() as usize, HEAP_SIZE) } } let mut xs = Vec::new();