pyo3/tests/ui/not_send2.stderr

54 lines
2.4 KiB
Plaintext
Raw Permalink Normal View History

2023-11-21 11:41:43 +00:00
error[E0277]: `*mut pyo3::Python<'static>` cannot be shared between threads safely
2022-11-04 04:29:23 +00:00
--> tests/ui/not_send2.rs:8:26
|
8 | py.allow_threads(|| {
| ____________-------------_^
| | |
| | required by a bound introduced by this call
9 | | println!("{:?}", string);
10 | | });
2023-11-21 11:41:43 +00:00
| |_________^ `*mut pyo3::Python<'static>` cannot be shared between threads safely
2022-11-04 04:29:23 +00:00
|
= help: within `pyo3::Bound<'_, PyString>`, the trait `Sync` is not implemented for `*mut pyo3::Python<'static>`, which is required by `{closure@$DIR/tests/ui/not_send2.rs:8:26: 8:28}: Ungil`
2024-02-08 21:13:58 +00:00
note: required because it appears within the type `PhantomData<*mut pyo3::Python<'static>>`
2023-11-21 11:41:43 +00:00
--> $RUST/core/src/marker.rs
2023-07-14 09:28:17 +00:00
|
2023-11-21 11:41:43 +00:00
| pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
2024-02-08 21:13:58 +00:00
note: required because it appears within the type `impl_::not_send::NotSend`
2023-11-21 11:41:43 +00:00
--> src/impl_/not_send.rs
|
| pub(crate) struct NotSend(PhantomData<*mut Python<'static>>);
| ^^^^^^^
2024-02-08 21:13:58 +00:00
= note: required because it appears within the type `(&pyo3::gil::GILGuard, impl_::not_send::NotSend)`
note: required because it appears within the type `PhantomData<(&pyo3::gil::GILGuard, impl_::not_send::NotSend)>`
2023-11-21 11:41:43 +00:00
--> $RUST/core/src/marker.rs
|
| pub struct PhantomData<T: ?Sized>;
| ^^^^^^^^^^^
2024-02-08 21:13:58 +00:00
note: required because it appears within the type `pyo3::Python<'_>`
2023-11-21 11:41:43 +00:00
--> src/marker.rs
|
| pub struct Python<'py>(PhantomData<(&'py GILGuard, NotSend)>);
| ^^^^^^
2024-02-08 21:13:58 +00:00
note: required because it appears within the type `pyo3::Bound<'_, PyString>`
2023-11-21 11:41:43 +00:00
--> src/instance.rs
2023-07-14 09:28:17 +00:00
|
2023-11-21 11:41:43 +00:00
| pub struct Bound<'py, T>(Python<'py>, ManuallyDrop<Py<T>>);
| ^^^^^
= note: required for `&pyo3::Bound<'_, PyString>` to implement `Send`
2022-08-12 06:26:29 +00:00
note: required because it's used within this closure
2022-11-04 04:29:23 +00:00
--> tests/ui/not_send2.rs:8:26
|
8 | py.allow_threads(|| {
| ^^
2023-11-16 16:06:01 +00:00
= note: required for `{closure@$DIR/tests/ui/not_send2.rs:8:26: 8:28}` to implement `Ungil`
note: required by a bound in `pyo3::Python::<'py>::allow_threads`
2022-11-04 04:29:23 +00:00
--> src/marker.rs
|
2023-07-14 09:28:17 +00:00
| pub fn allow_threads<T, F>(self, f: F) -> T
| ------------- required by a bound in this associated function
| where
2022-11-04 04:29:23 +00:00
| F: Ungil + FnOnce() -> T,
2023-03-09 23:41:26 +00:00
| ^^^^^ required by this bound in `Python::<'py>::allow_threads`