heapless/tests/cpass.rs
2021-03-25 17:45:10 +01:00

26 lines
523 B
Rust

//! Collections of `Send`-able things are `Send`
use heapless::{
spsc::{Consumer, Producer, Queue, MultiCore},
HistoryBuffer, Vec,
};
#[test]
fn send() {
struct IsSend;
unsafe impl Send for IsSend {}
fn is_send<T>()
where
T: Send,
{
}
is_send::<Consumer<IsSend, usize, MultiCore, 4>>();
is_send::<Producer<IsSend, usize, MultiCore, 4>>();
is_send::<Queue<IsSend, usize, MultiCore, 4>>();
is_send::<Vec<IsSend, 4>>();
is_send::<HistoryBuffer<IsSend, 4>>();
}