|
| 1 | +error[E0277]: `*mut c_void` cannot be sent between threads safely |
| 2 | + --> tests/ui/invalid_closure_send.rs:19:50 |
| 3 | + | |
| 4 | + 12 | let closure_fn = move |_args: &Bound<'_, PyTuple>, |
| 5 | + | __________________________- |
| 6 | + 13 | | _kwargs: Option<&Bound<'_, PyDict>>| |
| 7 | + 14 | | -> PyResult<()> { |
| 8 | + | |_____________________________- within this `{closure@tests/ui/invalid_closure_send.rs:12:26: 14:30}` |
| 9 | +... |
| 10 | + 19 | PyCFunction::new_closure(py, None, None, closure_fn).unwrap(); |
| 11 | + | ------------------------ ^^^^^^^^^^ `*mut c_void` cannot be sent between threads safely |
| 12 | + | | |
| 13 | + | required by a bound introduced by this call |
| 14 | + | |
| 15 | + = help: within `{closure@tests/ui/invalid_closure_send.rs:12:26: 14:30}`, the trait `Send` is not implemented for `*mut c_void` |
| 16 | +note: required because it appears within the type `NotSend` |
| 17 | + --> tests/ui/invalid_closure_send.rs:5:8 |
| 18 | + | |
| 19 | + 5 | struct NotSend(*mut std::ffi::c_void); |
| 20 | + | ^^^^^^^ |
| 21 | +note: required because it's used within this closure |
| 22 | + --> tests/ui/invalid_closure_send.rs:12:26 |
| 23 | + | |
| 24 | + 12 | let closure_fn = move |_args: &Bound<'_, PyTuple>, |
| 25 | + | __________________________^ |
| 26 | + 13 | | _kwargs: Option<&Bound<'_, PyDict>>| |
| 27 | + 14 | | -> PyResult<()> { |
| 28 | + | |_____________________________^ |
| 29 | +note: required by a bound in `PyCFunction::new_closure` |
| 30 | + --> src/types/function.rs |
| 31 | + | |
| 32 | + | pub fn new_closure<'py, F, R>( |
| 33 | + | ----------- required by a bound in this associated function |
| 34 | +... |
| 35 | + | F: Fn(&Bound<'_, PyTuple>, Option<&Bound<'_, PyDict>>) -> R + Send + Sync + 'static, |
| 36 | + | ^^^^ required by this bound in `PyCFunction::new_closure` |
| 37 | + |
| 38 | +error: aborting due to 1 previous error |
| 39 | + |
| 40 | +For more information about this error, try `rustc --explain E0277`. |
0 commit comments