From 5bde47c214829c22c56b57dfbbb6868a5c9c55b4 Mon Sep 17 00:00:00 2001 From: Roman Proskuryakov Date: Sun, 28 Mar 2021 10:58:00 +0300 Subject: [PATCH] Fix cfail tests --- cfail/ui/freeze.rs | 4 +- cfail/ui/not-send.rs | 9 ++- cfail/ui/not-send.stderr | 124 +++++++++++++++++---------------------- 3 files changed, 61 insertions(+), 76 deletions(-) diff --git a/cfail/ui/freeze.rs b/cfail/ui/freeze.rs index d1adc1f1..b5e5ace6 100644 --- a/cfail/ui/freeze.rs +++ b/cfail/ui/freeze.rs @@ -1,7 +1,7 @@ -use heapless::{consts, spsc::Queue}; +use heapless::{spsc::Queue}; fn main() { - let mut q: Queue = Queue::new(); + let mut q: Queue = Queue::new(); let (_p, mut _c) = q.split(); q.enqueue(0).unwrap(); diff --git a/cfail/ui/not-send.rs b/cfail/ui/not-send.rs index cdd13594..f5ea87c6 100644 --- a/cfail/ui/not-send.rs +++ b/cfail/ui/not-send.rs @@ -3,7 +3,6 @@ use core::marker::PhantomData; use heapless::{ - consts, spsc::{Consumer, Producer, Queue}, }; @@ -16,8 +15,8 @@ where } fn main() { - is_send::>(); - is_send::>(); - is_send::>(); - is_send::>(); + is_send::>(); + is_send::>(); + is_send::>(); + is_send::>(); } diff --git a/cfail/ui/not-send.stderr b/cfail/ui/not-send.stderr index a1813b62..878e9243 100644 --- a/cfail/ui/not-send.stderr +++ b/cfail/ui/not-send.stderr @@ -1,83 +1,69 @@ +error[E0277]: `*const ()` cannot be sent between threads safely + --> $DIR/not-send.rs:18:5 + | +11 | fn is_send() + | ------- required by a bound in this +12 | where +13 | T: Send, + | ---- required by this bound in `is_send` +... +18 | is_send::>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely + | + = help: within `PhantomData<*const ()>`, the trait `Send` is not implemented for `*const ()` + = note: required because it appears within the type `PhantomData<*const ()>` + = note: required because of the requirements on the impl of `Send` for `Consumer<'_, PhantomData<*const ()>, _, _, 4_usize>` + error[E0277]: `*const ()` cannot be sent between threads safely --> $DIR/not-send.rs:19:5 | -19 | is_send::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely +11 | fn is_send() + | ------- required by a bound in this +12 | where +13 | T: Send, + | ---- required by this bound in `is_send` +... +19 | is_send::>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely | - = help: within `std::marker::PhantomData<*const ()>`, the trait `std::marker::Send` is not implemented for `*const ()` - = note: required because it appears within the type `std::marker::PhantomData<*const ()>` - = note: required because of the requirements on the impl of `std::marker::Send` for `heapless::spsc::split::Consumer<'_, std::marker::PhantomData<*const ()>, typenum::uint::UInt, typenum::bit::B0>, typenum::bit::B0>>` -note: required by `is_send` - --> $DIR/not-send.rs:12:1 - | -12 | / fn is_send() -13 | | where -14 | | T: Send, -15 | | { -16 | | } - | |_^ + = help: within `PhantomData<*const ()>`, the trait `Send` is not implemented for `*const ()` + = note: required because it appears within the type `PhantomData<*const ()>` + = note: required because of the requirements on the impl of `Send` for `Producer<'_, PhantomData<*const ()>, _, _, 4_usize>` error[E0277]: `*const ()` cannot be sent between threads safely --> $DIR/not-send.rs:20:5 | -20 | is_send::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely +11 | fn is_send() + | ------- required by a bound in this +12 | where +13 | T: Send, + | ---- required by this bound in `is_send` +... +20 | is_send::>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely | - = help: within `std::marker::PhantomData<*const ()>`, the trait `std::marker::Send` is not implemented for `*const ()` - = note: required because it appears within the type `std::marker::PhantomData<*const ()>` - = note: required because of the requirements on the impl of `std::marker::Send` for `heapless::spsc::split::Producer<'_, std::marker::PhantomData<*const ()>, typenum::uint::UInt, typenum::bit::B0>, typenum::bit::B0>>` -note: required by `is_send` - --> $DIR/not-send.rs:12:1 - | -12 | / fn is_send() -13 | | where -14 | | T: Send, -15 | | { -16 | | } - | |_^ + = help: within `Queue, _, _, 4_usize>`, the trait `Send` is not implemented for `*const ()` + = note: required because it appears within the type `PhantomData<*const ()>` + = note: required because it appears within the type `[PhantomData<*const ()>; 4]` + = note: required because it appears within the type `ManuallyDrop<[PhantomData<*const ()>; 4]>` + = note: required because it appears within the type `MaybeUninit<[PhantomData<*const ()>; 4]>` + = note: required because it appears within the type `Queue, _, _, 4_usize>` error[E0277]: `*const ()` cannot be sent between threads safely --> $DIR/not-send.rs:21:5 | -21 | is_send::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely +11 | fn is_send() + | ------- required by a bound in this +12 | where +13 | T: Send, + | ---- required by this bound in `is_send` +... +21 | is_send::>(); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely | - = help: within `std::marker::PhantomData<*const ()>`, the trait `std::marker::Send` is not implemented for `*const ()` - = note: required because it appears within the type `std::marker::PhantomData<*const ()>` - = note: required because of the requirements on the impl of `std::marker::Send` for `generic_array::GenericArray, typenum::uint::UInt, typenum::bit::B0>, typenum::bit::B0>>` - = note: required because it appears within the type `std::mem::ManuallyDrop, typenum::uint::UInt, typenum::bit::B0>, typenum::bit::B0>>>` - = note: required because it appears within the type `std::mem::MaybeUninit, typenum::uint::UInt, typenum::bit::B0>, typenum::bit::B0>>>` - = note: required because it appears within the type `heapless::i::Queue, typenum::uint::UInt, typenum::bit::B0>, typenum::bit::B0>>>` - = note: required because it appears within the type `heapless::spsc::Queue, typenum::uint::UInt, typenum::bit::B0>, typenum::bit::B0>>` -note: required by `is_send` - --> $DIR/not-send.rs:12:1 - | -12 | / fn is_send() -13 | | where -14 | | T: Send, -15 | | { -16 | | } - | |_^ - -error[E0277]: `*const ()` cannot be sent between threads safely - --> $DIR/not-send.rs:22:5 - | -22 | is_send::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely - | - = help: within `std::marker::PhantomData<*const ()>`, the trait `std::marker::Send` is not implemented for `*const ()` - = note: required because it appears within the type `std::marker::PhantomData<*const ()>` - = note: required because of the requirements on the impl of `std::marker::Send` for `generic_array::GenericArray, typenum::uint::UInt, typenum::bit::B0>, typenum::bit::B0>>` - = note: required because it appears within the type `std::mem::ManuallyDrop, typenum::uint::UInt, typenum::bit::B0>, typenum::bit::B0>>>` - = note: required because it appears within the type `std::mem::MaybeUninit, typenum::uint::UInt, typenum::bit::B0>, typenum::bit::B0>>>` - = note: required because it appears within the type `heapless::i::Vec, typenum::uint::UInt, typenum::bit::B0>, typenum::bit::B0>>>` - = note: required because it appears within the type `heapless::vec::Vec, typenum::uint::UInt, typenum::bit::B0>, typenum::bit::B0>>` -note: required by `is_send` - --> $DIR/not-send.rs:12:1 - | -12 | / fn is_send() -13 | | where -14 | | T: Send, -15 | | { -16 | | } - | |_^ + = help: within `heapless::Vec, 4_usize>`, the trait `Send` is not implemented for `*const ()` + = note: required because it appears within the type `PhantomData<*const ()>` + = note: required because it appears within the type `[PhantomData<*const ()>; 4]` + = note: required because it appears within the type `ManuallyDrop<[PhantomData<*const ()>; 4]>` + = note: required because it appears within the type `MaybeUninit<[PhantomData<*const ()>; 4]>` + = note: required because it appears within the type `heapless::Vec, 4_usize>`