From 2021aa0e6297cd071968ca2956c8a13abab79f39 Mon Sep 17 00:00:00 2001 From: Per <Per Lindgren> Date: Tue, 27 Nov 2018 13:25:59 +0100 Subject: [PATCH] rust no_std no debug --- rust/Cargo.toml | 2 +- rust/src/main.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 98c2bc9..88bd23c 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -12,5 +12,5 @@ panic = "abort" [profile.release] panic = "abort" codegen-units = 1 # better optimizations -debug = true # symbols are nice and they don't increase the size on Flash +# debug = true # symbols are nice and they don't increase the size on Flash lto = true # better optimizations \ No newline at end of file diff --git a/rust/src/main.rs b/rust/src/main.rs index a3edf80..711435e 100644 --- a/rust/src/main.rs +++ b/rust/src/main.rs @@ -6,6 +6,7 @@ use core::intrinsics; use core::panic::PanicInfo; +use core::ptr; #[panic_handler] fn panic(_info: &PanicInfo) -> ! { @@ -14,7 +15,7 @@ fn panic(_info: &PanicInfo) -> ! { #[inline(never)] fn f1() -> u32 { - 0 + unsafe { ptr::read_volatile(&0) } } #[no_mangle] -- GitLab