fix the allocator example
importing alloc is a bit weird
This commit is contained in:
@@ -14,11 +14,12 @@
|
||||
#![no_main]
|
||||
#![no_std]
|
||||
|
||||
extern crate alloc;
|
||||
extern crate panic_halt;
|
||||
|
||||
use self::alloc::vec;
|
||||
use core::alloc::Layout;
|
||||
|
||||
use alloc::vec;
|
||||
use alloc_cortex_m::CortexMHeap;
|
||||
use cortex_m::asm;
|
||||
use cortex_m_rt::entry;
|
||||
@@ -40,6 +41,10 @@ fn main() -> ! {
|
||||
|
||||
hprintln!("{:?}", xs).unwrap();
|
||||
|
||||
// exit QEMU
|
||||
// NOTE do not run this on hardware; it can corrupt OpenOCD state
|
||||
debug::exit(debug::EXIT_SUCCESS);
|
||||
|
||||
loop {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user