diff options
author | 2020-08-23 21:57:08 +0200 | |
---|---|---|
committer | 2020-08-23 21:57:08 +0200 | |
commit | 679d42223fe79759bc634675694c46ae8ba0ce62 (patch) | |
tree | 141c8540c6e2b90ddd1d8b46ca284b6422103289 /cortex-m-rt/tests/compile-fail/unsafe-init-static.rs | |
parent | 972f60f50e48c07fda40d2b853558c7db9b5a4ff (diff) | |
download | cortex-m-679d42223fe79759bc634675694c46ae8ba0ce62.tar.gz cortex-m-679d42223fe79759bc634675694c46ae8ba0ce62.tar.zst cortex-m-679d42223fe79759bc634675694c46ae8ba0ce62.zip |
Make it unsafe to define NMI handlers
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 {} } |