heapless/tests/cpass.rs
Emil Fresk 6fdcc4fb99 New SPSC queue, now safe and much simpler
This commit implements a new, simplified, SPSC that does not have the
reported issues (e.g. not properly wrapping the indexes for non
powers-of-2), and the support for multiple different index sizes has
been removed for simplicity.
2021-04-18 19:18:56 +02:00

26 lines
458 B
Rust

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