From f7a943f480dbf2268363783891c47613db6b74b7 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 10 Nov 2018 00:01:25 +0100 Subject: [PATCH] fix the allocator example importing alloc is a bit weird --- examples/allocator.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/allocator.rs b/examples/allocator.rs index e0a5ef4..0399ebb 100644 --- a/examples/allocator.rs +++ b/examples/allocator.rs @@ -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 {} }