aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/cfail/critical-section.rs1
-rw-r--r--tests/cfail/duplicated-task.rs1
-rw-r--r--tests/cfail/exception.rs1
-rw-r--r--tests/cfail/idle.rs1
-rw-r--r--tests/cfail/init.rs1
-rw-r--r--tests/cfail/interrupt.rs1
-rw-r--r--tests/cfail/late-resource-init.rs1
-rw-r--r--tests/cfail/lock.rs1
-rw-r--r--tests/cfail/peripheral-alias.rs1
-rw-r--r--tests/cfail/priority-too-high.rs1
-rw-r--r--tests/cfail/priority-too-low.rs1
-rw-r--r--tests/cfail/resource-alias.rs1
-rw-r--r--tests/cfail/resource-not-send.rs53
-rw-r--r--tests/cfail/token-outlive.rs1
-rw-r--r--tests/cfail/token-transfer.rs1
-rw-r--r--tests/cfail/wrong-threshold.rs1
16 files changed, 68 insertions, 0 deletions
diff --git a/tests/cfail/critical-section.rs b/tests/cfail/critical-section.rs
index 728388e8..65719788 100644
--- a/tests/cfail/critical-section.rs
+++ b/tests/cfail/critical-section.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(const_fn)]
#![feature(proc_macro)]
diff --git a/tests/cfail/duplicated-task.rs b/tests/cfail/duplicated-task.rs
index d91f09b6..82b7ac63 100644
--- a/tests/cfail/duplicated-task.rs
+++ b/tests/cfail/duplicated-task.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
#![no_std]
diff --git a/tests/cfail/exception.rs b/tests/cfail/exception.rs
index 065ccad8..e2e749a2 100644
--- a/tests/cfail/exception.rs
+++ b/tests/cfail/exception.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
#![no_std]
diff --git a/tests/cfail/idle.rs b/tests/cfail/idle.rs
index a362ec79..79fe99b0 100644
--- a/tests/cfail/idle.rs
+++ b/tests/cfail/idle.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
#![no_std]
diff --git a/tests/cfail/init.rs b/tests/cfail/init.rs
index 73643b11..d2823e3f 100644
--- a/tests/cfail/init.rs
+++ b/tests/cfail/init.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
#![no_std]
diff --git a/tests/cfail/interrupt.rs b/tests/cfail/interrupt.rs
index b913d832..e3ef2e8f 100644
--- a/tests/cfail/interrupt.rs
+++ b/tests/cfail/interrupt.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
#![no_std]
diff --git a/tests/cfail/late-resource-init.rs b/tests/cfail/late-resource-init.rs
index cb37887f..a1059f34 100644
--- a/tests/cfail/late-resource-init.rs
+++ b/tests/cfail/late-resource-init.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
#![no_std]
diff --git a/tests/cfail/lock.rs b/tests/cfail/lock.rs
index e0e37e0f..5630649a 100644
--- a/tests/cfail/lock.rs
+++ b/tests/cfail/lock.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(const_fn)]
#![feature(proc_macro)]
diff --git a/tests/cfail/peripheral-alias.rs b/tests/cfail/peripheral-alias.rs
index 042666af..3528ec66 100644
--- a/tests/cfail/peripheral-alias.rs
+++ b/tests/cfail/peripheral-alias.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
#![no_std]
diff --git a/tests/cfail/priority-too-high.rs b/tests/cfail/priority-too-high.rs
index c139471d..5c353770 100644
--- a/tests/cfail/priority-too-high.rs
+++ b/tests/cfail/priority-too-high.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
#![no_std]
diff --git a/tests/cfail/priority-too-low.rs b/tests/cfail/priority-too-low.rs
index cefd3428..2be2254d 100644
--- a/tests/cfail/priority-too-low.rs
+++ b/tests/cfail/priority-too-low.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
#![no_std]
diff --git a/tests/cfail/resource-alias.rs b/tests/cfail/resource-alias.rs
index 788af6f6..e1c73bb5 100644
--- a/tests/cfail/resource-alias.rs
+++ b/tests/cfail/resource-alias.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
#![no_std]
diff --git a/tests/cfail/resource-not-send.rs b/tests/cfail/resource-not-send.rs
new file mode 100644
index 00000000..c89c3d31
--- /dev/null
+++ b/tests/cfail/resource-not-send.rs
@@ -0,0 +1,53 @@
+#![deny(unsafe_code)]
+#![deny(warnings)]
+#![feature(const_fn)]
+#![feature(proc_macro)]
+#![no_std]
+
+extern crate cortex_m_rtfm as rtfm;
+extern crate stm32f103xx;
+
+use rtfm::{app, Resource, Threshold};
+
+app! {
+ device: stm32f103xx,
+
+ resources: {
+ static SHARED: bool = false;
+ },
+
+ tasks: {
+ EXTI0: {
+ path: exti0,
+ priority: 1,
+ resources: [SHARED],
+ },
+
+ EXTI1: {
+ path: exti1,
+ priority: 2,
+ resources: [SHARED],
+ },
+ },
+}
+
+fn init(_p: init::Peripherals, _r: init::Resources) {}
+
+fn idle() -> ! {
+ loop {}
+}
+
+fn is_send<T>(_: &T) where T: Send {}
+fn is_sync<T>(_: &T) where T: Sync {}
+
+fn exti0(_t: &mut Threshold, r: EXTI0::Resources) {
+ // OK
+ is_sync(&r.SHARED);
+
+ // ERROR resource proxies are not `Send`able across tasks
+ is_send(&r.SHARED);
+ //~^ error the trait bound `*const (): core::marker::Send` is not satisfied
+}
+
+fn exti1(_t: &mut Threshold, _r: EXTI1::Resources) {
+}
diff --git a/tests/cfail/token-outlive.rs b/tests/cfail/token-outlive.rs
index 31231b72..819a3d15 100644
--- a/tests/cfail/token-outlive.rs
+++ b/tests/cfail/token-outlive.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(const_fn)]
#![feature(proc_macro)]
diff --git a/tests/cfail/token-transfer.rs b/tests/cfail/token-transfer.rs
index 38e87868..bc620521 100644
--- a/tests/cfail/token-transfer.rs
+++ b/tests/cfail/token-transfer.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(const_fn)]
#![feature(proc_macro)]
diff --git a/tests/cfail/wrong-threshold.rs b/tests/cfail/wrong-threshold.rs
index b9740715..149f357d 100644
--- a/tests/cfail/wrong-threshold.rs
+++ b/tests/cfail/wrong-threshold.rs
@@ -1,3 +1,4 @@
+#![deny(unsafe_code)]
#![deny(warnings)]
#![feature(proc_macro)]
#![no_std]