diff options
| author | Jorge Aparicio <jorge@japaric.io> | 2017-07-23 20:51:58 -0500 |
|---|---|---|
| committer | Jorge Aparicio <jorge@japaric.io> | 2017-07-23 20:51:58 -0500 |
| commit | 6ea9cda6635e7536523f3c6d3d217f7d474ae4a2 (patch) | |
| tree | c5617f6b60531891231ba2b5b029f957562a085f /tests/cfail/local-token.rs | |
| parent | 05feb7b018817f88123900c9196e830d51608a5f (diff) | |
update cfail tests
Diffstat (limited to 'tests/cfail/local-token.rs')
| -rw-r--r-- | tests/cfail/local-token.rs | 7 |
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 } |
