aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--macros/src/trans.rs20
-rw-r--r--tests/cfail/interrupt.rs6
-rw-r--r--tests/cfail/token-transfer.rs7
3 files changed, 10 insertions, 23 deletions
diff --git a/macros/src/trans.rs b/macros/src/trans.rs
index a6dcf8ab..c65aaa52 100644
--- a/macros/src/trans.rs
+++ b/macros/src/trans.rs
@@ -12,7 +12,6 @@ pub fn app(app: &App, ownerships: &Ownerships) -> Tokens {
let mut root = vec![];
let mut main = vec![];
- ::trans::check(app, &mut main);
::trans::init(app, &mut main, &mut root);
::trans::idle(app, ownerships, &mut main, &mut root);
::trans::resources(app, ownerships, &mut root);
@@ -28,25 +27,6 @@ pub fn app(app: &App, ownerships: &Ownerships) -> Tokens {
quote!(#(#root)*)
}
-// Checks that the resource types are valid
-// Sadly we can't do this test at expansion time. Instead we'll generate some
-// code that won't compile if the types don't meet the requirements
-fn check(app: &App, main: &mut Vec<Tokens>) {
- if !app.resources.is_empty() {
- main.push(quote! {
- fn is_send<T>() where T: Send {}
- });
- }
-
- for resource in app.resources.values() {
- let ty = &resource.ty;
-
- main.push(quote! {
- is_send::<#ty>();
- });
- }
-}
-
fn idle(
app: &App,
ownerships: &Ownerships,
diff --git a/tests/cfail/interrupt.rs b/tests/cfail/interrupt.rs
index c70528f0..f7879f49 100644
--- a/tests/cfail/interrupt.rs
+++ b/tests/cfail/interrupt.rs
@@ -14,7 +14,9 @@ app! {
tasks: {
// ERROR this interrupt doesn't exist
- EXTI33: {},
+ EXTI33: {
+ path: exti33,
+ },
},
}
@@ -23,3 +25,5 @@ fn init(_p: init::Peripherals) {}
fn idle() -> ! {
loop {}
}
+
+fn exti33() {}
diff --git a/tests/cfail/token-transfer.rs b/tests/cfail/token-transfer.rs
index d10b82b2..38e87868 100644
--- a/tests/cfail/token-transfer.rs
+++ b/tests/cfail/token-transfer.rs
@@ -15,10 +15,13 @@ app! { //~ error bound `rtfm::Threshold: core::marker::Send` is not satisfied
static TOKEN: Option<Threshold> = None;
},
+ idle: {
+ resources: [TOKEN],
+ },
+
tasks: {
EXTI0: {
path: exti0,
- priority: 1,
resources: [TOKEN],
},
}
@@ -26,7 +29,7 @@ app! { //~ error bound `rtfm::Threshold: core::marker::Send` is not satisfied
fn init(_p: init::Peripherals, _r: init::Resources) {}
-fn idle() -> ! {
+fn idle(_t: &mut Threshold, _r: idle::Resources) -> ! {
loop {}
}