Skip to content

Commit 5bde47c

Browse files
committed
Fix cfail tests
1 parent 7fb276f commit 5bde47c

File tree

3 files changed

+60
-75
lines changed

3 files changed

+60
-75
lines changed

cfail/ui/freeze.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use heapless::{consts, spsc::Queue};
1+
use heapless::{spsc::Queue};
22

33
fn main() {
4-
let mut q: Queue<u8, consts::U4> = Queue::new();
4+
let mut q: Queue<u8, _, _, 4> = Queue::new();
55

66
let (_p, mut _c) = q.split();
77
q.enqueue(0).unwrap();

cfail/ui/not-send.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
use core::marker::PhantomData;
44

55
use heapless::{
6-
consts,
76
spsc::{Consumer, Producer, Queue},
87
};
98

@@ -16,8 +15,8 @@ where
1615
}
1716

1817
fn main() {
19-
is_send::<Consumer<NotSend, consts::U4>>();
20-
is_send::<Producer<NotSend, consts::U4>>();
21-
is_send::<Queue<NotSend, consts::U4>>();
22-
is_send::<heapless::Vec<NotSend, consts::U4>>();
18+
is_send::<Consumer<NotSend, _, _, 4>>();
19+
is_send::<Producer<NotSend, _, _, 4>>();
20+
is_send::<Queue<NotSend, _, _, 4>>();
21+
is_send::<heapless::Vec<NotSend, 4>>();
2322
}

cfail/ui/not-send.stderr

Lines changed: 54 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,69 @@
11
error[E0277]: `*const ()` cannot be sent between threads safely
2-
--> $DIR/not-send.rs:19:5
3-
|
4-
19 | is_send::<Consumer<NotSend, consts::U4>>();
5-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely
2+
--> $DIR/not-send.rs:18:5
63
|
7-
= help: within `std::marker::PhantomData<*const ()>`, the trait `std::marker::Send` is not implemented for `*const ()`
8-
= note: required because it appears within the type `std::marker::PhantomData<*const ()>`
9-
= 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::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>>`
10-
note: required by `is_send`
11-
--> $DIR/not-send.rs:12:1
4+
11 | fn is_send<T>()
5+
| ------- required by a bound in this
6+
12 | where
7+
13 | T: Send,
8+
| ---- required by this bound in `is_send`
9+
...
10+
18 | is_send::<Consumer<NotSend, _, _, 4>>();
11+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely
1212
|
13-
12 | / fn is_send<T>()
14-
13 | | where
15-
14 | | T: Send,
16-
15 | | {
17-
16 | | }
18-
| |_^
13+
= help: within `PhantomData<*const ()>`, the trait `Send` is not implemented for `*const ()`
14+
= note: required because it appears within the type `PhantomData<*const ()>`
15+
= note: required because of the requirements on the impl of `Send` for `Consumer<'_, PhantomData<*const ()>, _, _, 4_usize>`
1916

2017
error[E0277]: `*const ()` cannot be sent between threads safely
21-
--> $DIR/not-send.rs:20:5
22-
|
23-
20 | is_send::<Producer<NotSend, consts::U4>>();
24-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely
18+
--> $DIR/not-send.rs:19:5
2519
|
26-
= help: within `std::marker::PhantomData<*const ()>`, the trait `std::marker::Send` is not implemented for `*const ()`
27-
= note: required because it appears within the type `std::marker::PhantomData<*const ()>`
28-
= 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::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>>`
29-
note: required by `is_send`
30-
--> $DIR/not-send.rs:12:1
20+
11 | fn is_send<T>()
21+
| ------- required by a bound in this
22+
12 | where
23+
13 | T: Send,
24+
| ---- required by this bound in `is_send`
25+
...
26+
19 | is_send::<Producer<NotSend, _, _, 4>>();
27+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely
3128
|
32-
12 | / fn is_send<T>()
33-
13 | | where
34-
14 | | T: Send,
35-
15 | | {
36-
16 | | }
37-
| |_^
29+
= help: within `PhantomData<*const ()>`, the trait `Send` is not implemented for `*const ()`
30+
= note: required because it appears within the type `PhantomData<*const ()>`
31+
= note: required because of the requirements on the impl of `Send` for `Producer<'_, PhantomData<*const ()>, _, _, 4_usize>`
3832

3933
error[E0277]: `*const ()` cannot be sent between threads safely
40-
--> $DIR/not-send.rs:21:5
41-
|
42-
21 | is_send::<Queue<NotSend, consts::U4>>();
43-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely
34+
--> $DIR/not-send.rs:20:5
4435
|
45-
= help: within `std::marker::PhantomData<*const ()>`, the trait `std::marker::Send` is not implemented for `*const ()`
46-
= note: required because it appears within the type `std::marker::PhantomData<*const ()>`
47-
= note: required because of the requirements on the impl of `std::marker::Send` for `generic_array::GenericArray<std::marker::PhantomData<*const ()>, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>>`
48-
= note: required because it appears within the type `std::mem::ManuallyDrop<generic_array::GenericArray<std::marker::PhantomData<*const ()>, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>>>`
49-
= note: required because it appears within the type `std::mem::MaybeUninit<generic_array::GenericArray<std::marker::PhantomData<*const ()>, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>>>`
50-
= note: required because it appears within the type `heapless::i::Queue<generic_array::GenericArray<std::marker::PhantomData<*const ()>, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>>>`
51-
= note: required because it appears within the type `heapless::spsc::Queue<std::marker::PhantomData<*const ()>, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>>`
52-
note: required by `is_send`
53-
--> $DIR/not-send.rs:12:1
36+
11 | fn is_send<T>()
37+
| ------- required by a bound in this
38+
12 | where
39+
13 | T: Send,
40+
| ---- required by this bound in `is_send`
41+
...
42+
20 | is_send::<Queue<NotSend, _, _, 4>>();
43+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely
5444
|
55-
12 | / fn is_send<T>()
56-
13 | | where
57-
14 | | T: Send,
58-
15 | | {
59-
16 | | }
60-
| |_^
45+
= help: within `Queue<PhantomData<*const ()>, _, _, 4_usize>`, the trait `Send` is not implemented for `*const ()`
46+
= note: required because it appears within the type `PhantomData<*const ()>`
47+
= note: required because it appears within the type `[PhantomData<*const ()>; 4]`
48+
= note: required because it appears within the type `ManuallyDrop<[PhantomData<*const ()>; 4]>`
49+
= note: required because it appears within the type `MaybeUninit<[PhantomData<*const ()>; 4]>`
50+
= note: required because it appears within the type `Queue<PhantomData<*const ()>, _, _, 4_usize>`
6151

6252
error[E0277]: `*const ()` cannot be sent between threads safely
63-
--> $DIR/not-send.rs:22:5
64-
|
65-
22 | is_send::<heapless::Vec<NotSend, consts::U4>>();
66-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely
53+
--> $DIR/not-send.rs:21:5
6754
|
68-
= help: within `std::marker::PhantomData<*const ()>`, the trait `std::marker::Send` is not implemented for `*const ()`
69-
= note: required because it appears within the type `std::marker::PhantomData<*const ()>`
70-
= note: required because of the requirements on the impl of `std::marker::Send` for `generic_array::GenericArray<std::marker::PhantomData<*const ()>, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>>`
71-
= note: required because it appears within the type `std::mem::ManuallyDrop<generic_array::GenericArray<std::marker::PhantomData<*const ()>, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>>>`
72-
= note: required because it appears within the type `std::mem::MaybeUninit<generic_array::GenericArray<std::marker::PhantomData<*const ()>, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>>>`
73-
= note: required because it appears within the type `heapless::i::Vec<generic_array::GenericArray<std::marker::PhantomData<*const ()>, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>>>`
74-
= note: required because it appears within the type `heapless::vec::Vec<std::marker::PhantomData<*const ()>, typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UInt<typenum::uint::UTerm, typenum::bit::B1>, typenum::bit::B0>, typenum::bit::B0>>`
75-
note: required by `is_send`
76-
--> $DIR/not-send.rs:12:1
55+
11 | fn is_send<T>()
56+
| ------- required by a bound in this
57+
12 | where
58+
13 | T: Send,
59+
| ---- required by this bound in `is_send`
60+
...
61+
21 | is_send::<heapless::Vec<NotSend, 4>>();
62+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely
7763
|
78-
12 | / fn is_send<T>()
79-
13 | | where
80-
14 | | T: Send,
81-
15 | | {
82-
16 | | }
83-
| |_^
64+
= help: within `heapless::Vec<PhantomData<*const ()>, 4_usize>`, the trait `Send` is not implemented for `*const ()`
65+
= note: required because it appears within the type `PhantomData<*const ()>`
66+
= note: required because it appears within the type `[PhantomData<*const ()>; 4]`
67+
= note: required because it appears within the type `ManuallyDrop<[PhantomData<*const ()>; 4]>`
68+
= note: required because it appears within the type `MaybeUninit<[PhantomData<*const ()>; 4]>`
69+
= note: required because it appears within the type `heapless::Vec<PhantomData<*const ()>, 4_usize>`

0 commit comments

Comments
 (0)