mirror of
https://github.com/rust-embedded/heapless.git
synced 2025-09-30 05:50:29 +00:00
24 lines
451 B
Rust
24 lines
451 B
Rust
//! Collections of non-`Send`-able things are *not* `Send`
|
|
|
|
use core::marker::PhantomData;
|
|
|
|
use heapless::{
|
|
consts,
|
|
spsc::{Consumer, Producer, Queue},
|
|
};
|
|
|
|
type NotSend = PhantomData<*const ()>;
|
|
|
|
fn is_send<T>()
|
|
where
|
|
T: Send,
|
|
{
|
|
}
|
|
|
|
fn main() {
|
|
is_send::<Consumer<NotSend, consts::U4>>();
|
|
is_send::<Producer<NotSend, consts::U4>>();
|
|
is_send::<Queue<NotSend, consts::U4>>();
|
|
is_send::<heapless::Vec<NotSend, consts::U4>>();
|
|
}
|