Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cfail/ui/freeze.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use heapless::{spsc::Queue};

fn main() {
let mut q: Queue<u8, _, _, 4> = Queue::new();
let mut q: Queue<u8, _, 4> = Queue::new();

let (_p, mut _c) = q.split();
q.enqueue(0).unwrap();
Expand Down
22 changes: 9 additions & 13 deletions cfail/ui/freeze.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
error[E0107]: this struct takes 3 generic arguments but 4 generic arguments were supplied
--> $DIR/freeze.rs:4:16
|
4 | let mut q: Queue<u8, _, _, 4> = Queue::new();
| ^^^^^ --- help: remove this generic argument
| |
| expected 3 generic arguments
|
note: struct defined here, with 3 generic parameters: `T`, `U`, `N`
--> $DIR/mod.rs:151:12
|
151 | pub struct Queue<T, U, const N: usize>
| ^^^^^ - - -
error[E0499]: cannot borrow `q` as mutable more than once at a time
--> $DIR/freeze.rs:7:5
|
6 | let (_p, mut _c) = q.split();
| - first mutable borrow occurs here
7 | q.enqueue(0).unwrap();
| ^ second mutable borrow occurs here
8 | _c.dequeue();
| -- first borrow later used here
6 changes: 3 additions & 3 deletions cfail/ui/not-send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ where
}

fn main() {
is_send::<Consumer<NotSend, _, _, 4>>();
is_send::<Producer<NotSend, _, _, 4>>();
is_send::<Queue<NotSend, _, _, 4>>();
is_send::<Consumer<NotSend, _, 4>>();
is_send::<Producer<NotSend, _, 4>>();
is_send::<Queue<NotSend, _, 4>>();
is_send::<heapless::Vec<NotSend, 4>>();
}
79 changes: 44 additions & 35 deletions cfail/ui/not-send.stderr
Original file line number Diff line number Diff line change
@@ -1,44 +1,53 @@
error[E0107]: this struct takes 3 generic arguments but 4 generic arguments were supplied
--> $DIR/not-send.rs:18:15
|
18 | is_send::<Consumer<NotSend, _, _, 4>>();
| ^^^^^^^^ --- help: remove this generic argument
| |
| expected 3 generic arguments
error[E0277]: `*const ()` cannot be sent between threads safely
--> $DIR/not-send.rs:18:5
|
note: struct defined here, with 3 generic parameters: `T`, `U`, `N`
--> $DIR/split.rs:26:12
11 | fn is_send<T>()
| ------- required by a bound in this
12 | where
13 | T: Send,
| ---- required by this bound in `is_send`
...
18 | is_send::<Consumer<NotSend, _, 4>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely
|
26 | pub struct Consumer<'a, T, U, const N: usize>
| ^^^^^^^^ - - -
= 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[E0107]: this struct takes 3 generic arguments but 4 generic arguments were supplied
--> $DIR/not-send.rs:19:15
|
19 | is_send::<Producer<NotSend, _, _, 4>>();
| ^^^^^^^^ --- help: remove this generic argument
| |
| expected 3 generic arguments
error[E0277]: `*const ()` cannot be sent between threads safely
--> $DIR/not-send.rs:19:5
|
note: struct defined here, with 3 generic parameters: `T`, `U`, `N`
--> $DIR/split.rs:43:12
11 | fn is_send<T>()
| ------- required by a bound in this
12 | where
13 | T: Send,
| ---- required by this bound in `is_send`
...
19 | is_send::<Producer<NotSend, _, 4>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely
|
43 | pub struct Producer<'a, T, U, const N: usize>
| ^^^^^^^^ - - -
= 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[E0107]: this struct takes 3 generic arguments but 4 generic arguments were supplied
--> $DIR/not-send.rs:20:15
|
20 | is_send::<Queue<NotSend, _, _, 4>>();
| ^^^^^ --- help: remove this generic argument
| |
| expected 3 generic arguments
|
note: struct defined here, with 3 generic parameters: `T`, `U`, `N`
--> $DIR/mod.rs:151:12
|
151 | pub struct Queue<T, U, const N: usize>
| ^^^^^ - - -
error[E0277]: `*const ()` cannot be sent between threads safely
--> $DIR/not-send.rs:20:5
|
11 | fn is_send<T>()
| ------- required by a bound in this
12 | where
13 | T: Send,
| ---- required by this bound in `is_send`
...
20 | is_send::<Queue<NotSend, _, 4>>();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `*const ()` cannot be sent between threads safely
|
= help: within `Queue<PhantomData<*const ()>, _, 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<PhantomData<*const ()>, _, 4_usize>`

error[E0277]: `*const ()` cannot be sent between threads safely
--> $DIR/not-send.rs:21:5
Expand Down