diff options
author | 2020-08-23 22:16:07 +0000 | |
---|---|---|
committer | 2020-08-23 22:16:07 +0000 | |
commit | f4a85dcc92e90e27588cbe14e0447b89f672e30f (patch) | |
tree | 4af03e376f2c48f35109f3da21c5e96354975b4d /cortex-m-rt/tests/compile-fail/unsafe-init-static.rs | |
parent | cbb3c4e63079a2a70b09f8038606b1c51f34675d (diff) | |
parent | bb868f4a90c6eff142801bc1a19b135483eed312 (diff) | |
download | cortex-m-f4a85dcc92e90e27588cbe14e0447b89f672e30f.tar.gz cortex-m-f4a85dcc92e90e27588cbe14e0447b89f672e30f.tar.zst cortex-m-f4a85dcc92e90e27588cbe14e0447b89f672e30f.zip |
Merge #289
289: Make it unsafe to define NMI handlers r=therealprof a=jonas-schievink
Reverts https://github.com/rust-embedded/cortex-m-rt/pull/257
Fixes https://github.com/rust-embedded/cortex-m-rt/issues/269
Fixes https://github.com/rust-embedded/cortex-m/issues/196 (see that thread for details)
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Diffstat (limited to 'cortex-m-rt/tests/compile-fail/unsafe-init-static.rs')
-rw-r--r-- | cortex-m-rt/tests/compile-fail/unsafe-init-static.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cortex-m-rt/tests/compile-fail/unsafe-init-static.rs b/cortex-m-rt/tests/compile-fail/unsafe-init-static.rs index c040173..23105f1 100644 --- a/cortex-m-rt/tests/compile-fail/unsafe-init-static.rs +++ b/cortex-m-rt/tests/compile-fail/unsafe-init-static.rs @@ -29,12 +29,12 @@ fn SVCall() { } #[exception] -fn DefaultHandler(_irq: i16) { +unsafe fn DefaultHandler(_irq: i16) { static mut X: u32 = init(); //~ ERROR requires unsafe } #[exception] -fn HardFault(_frame: &cortex_m_rt::ExceptionFrame) -> ! { +unsafe fn HardFault(_frame: &cortex_m_rt::ExceptionFrame) -> ! { static mut X: u32 = init(); //~ ERROR requires unsafe loop {} } |