aboutsummaryrefslogtreecommitdiff
path: root/tests/cfail/local-token.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/cfail/local-token.rs')
-rw-r--r--tests/cfail/local-token.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/cfail/local-token.rs b/tests/cfail/local-token.rs
index 4c98956..90a9560 100644
--- a/tests/cfail/local-token.rs
+++ b/tests/cfail/local-token.rs
@@ -1,6 +1,7 @@
#![deny(warnings)]
#![feature(const_fn)]
#![feature(proc_macro)]
+#![no_std]
#[macro_use(task)]
extern crate cortex_m_rtfm as rtfm;
@@ -26,11 +27,11 @@ fn idle() -> ! {
}
task!(EXTI0, exti0, Old {
- token: Option<Threshold> = None;
+ static TOKEN: Option<Threshold> = None;
});
fn exti0(nt: &mut Threshold, old: &mut Old, _r: EXTI0::Resources) {
- if let Some(ot) = old.token.take() {
+ if let Some(ot) = old.TOKEN.take() {
let _: (Threshold, Threshold) = (*nt, ot);
//~^ error cannot move out of borrowed content
@@ -39,6 +40,6 @@ fn exti0(nt: &mut Threshold, old: &mut Old, _r: EXTI0::Resources) {
// ERROR can't store a threshold token in a local variable, otherwise you
// would end up with two threshold tokens in a task (see `if let` above)
- old.token = Some(*nt);
+ *old.TOKEN = Some(*nt);
//~^ error cannot move out of borrowed content
}