diff options
author | 2018-12-15 15:37:20 +0100 | |
---|---|---|
committer | 2018-12-15 15:37:20 +0100 | |
commit | c69ff66f4c1d353be5d683ca8c131a04e997e4ed (patch) | |
tree | 8565f0edc28016ea1acc1f14dd63591d21c3fe32 /cortex-m-rt/examples | |
parent | c7e6e5f78203b55b0094bd26d78e17c9c9d155a2 (diff) | |
download | cortex-m-c69ff66f4c1d353be5d683ca8c131a04e997e4ed.tar.gz cortex-m-c69ff66f4c1d353be5d683ca8c131a04e997e4ed.tar.zst cortex-m-c69ff66f4c1d353be5d683ca8c131a04e997e4ed.zip |
static mut transform: forward `#[cfg]`
Diffstat (limited to 'cortex-m-rt/examples')
-rw-r--r-- | cortex-m-rt/examples/cfg-static.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/cortex-m-rt/examples/cfg-static.rs b/cortex-m-rt/examples/cfg-static.rs new file mode 100644 index 0000000..2ffee13 --- /dev/null +++ b/cortex-m-rt/examples/cfg-static.rs @@ -0,0 +1,25 @@ +//! using `#[cfg]` on `static` shouldn't cause compile errors + +#![deny(unsafe_code)] +#![deny(warnings)] +#![no_main] +#![no_std] + +extern crate cortex_m_rt as rt; +extern crate panic_halt; + +use rt::{entry, exception}; + +#[entry] +fn main() -> ! { + #[cfg(never)] + static mut COUNT: u32 = 0; + + loop {} +} + +#[exception] +fn SysTick() { + #[cfg(never)] + static mut FOO: u32 = 0; +} |