fix the allocator example

importing alloc is a bit weird
This commit is contained in:
Jorge Aparicio
2018-11-10 00:01:25 +01:00
parent 9c6b290e12
commit f7a943f480

View File

@@ -14,11 +14,12 @@
#![no_main] #![no_main]
#![no_std] #![no_std]
extern crate alloc;
extern crate panic_halt; extern crate panic_halt;
use self::alloc::vec;
use core::alloc::Layout; use core::alloc::Layout;
use alloc::vec;
use alloc_cortex_m::CortexMHeap; use alloc_cortex_m::CortexMHeap;
use cortex_m::asm; use cortex_m::asm;
use cortex_m_rt::entry; use cortex_m_rt::entry;
@@ -40,6 +41,10 @@ fn main() -> ! {
hprintln!("{:?}", xs).unwrap(); hprintln!("{:?}", xs).unwrap();
// exit QEMU
// NOTE do not run this on hardware; it can corrupt OpenOCD state
debug::exit(debug::EXIT_SUCCESS);
loop {} loop {}
} }