mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-27 04:20:24 +00:00

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.
26 lines
458 B
Rust
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>>();
|
|
}
|