From 86a360a3964ecb04a37c0424c76d7b43a9fd40fe Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 4 Jul 2017 11:26:11 -0500 Subject: rtfm! macro take 2 --- tests/cfail/ceiling.rs | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 tests/cfail/ceiling.rs (limited to 'tests/cfail/ceiling.rs') diff --git a/tests/cfail/ceiling.rs b/tests/cfail/ceiling.rs deleted file mode 100644 index 118dbcf..0000000 --- a/tests/cfail/ceiling.rs +++ /dev/null @@ -1,29 +0,0 @@ -extern crate cortex_m_rtfm as rtfm; - -use rtfm::{C2, C3, P0, P2, Resource, T2}; - -static R1: Resource<(), C3> = Resource::new(()); - -fn j1(prio: P2, thr: T2) { - let t3 = thr.raise( - &R1, |thr| { - // forbidden: ceiling token can't outlive the critical section - thr //~ error - } - ); - - // Would be bad: lockless access to a resource with ceiling = 3 - let r2 = R1.access(&prio, t3); -} - -fn j2(prio: P0) { - let c16 = rtfm::atomic( - |c16| { - // forbidden: ceiling token can't outlive the critical section - c16 //~ error - }, - ); - - // Would be bad: lockless access to a resource with ceiling = 16 - let r1 = R1.access(&prio, c16); -} -- cgit v1.2.3