diff --git a/examples/bare0.rs b/examples/bare0.rs index 94a5e1d3f65489189d7b12842ba4d4d7ae4999b0..4e6507394d41ed3f703d6eaa6dfe7ac2cd3d1c22 100644 --- a/examples/bare0.rs +++ b/examples/bare0.rs @@ -26,8 +26,8 @@ extern crate panic_semihosting; use cortex_m_rt::entry; // a constant (cannot be changed at run-time) -const X_INIT: u32 = 10; -//const X_INIT: u32 = core::u32::MAX; +//const X_INIT: u32 = 10; +const X_INIT: u32 = core::u32::MAX; // global mutable variables (changed using unsafe code) static mut X: u32 = X_INIT; @@ -85,6 +85,8 @@ fn main() -> ! { // (Hint, look under OUTPUT/Adopter Output to see the `openocd` output.) // // ** your answer here ** +// First it says that the local x gets optimized out then it panics +// "panicked at 'attempt to add with overflow', examples/bare0.rs:42:9" // // Commit your answers (bare0_2) //