|
1 | 1 | error[E0277]: `*mut pyo3::Python<'static>` cannot be shared between threads safely |
2 | 2 | --> tests/ui/not_send2.rs:8:19 |
3 | | - | |
4 | | - 8 | py.detach(|| { |
5 | | - | ____________------_^ |
6 | | - | | | |
7 | | - | | required by a bound introduced by this call |
8 | | - 9 | | println!("{:?}", string); |
9 | | -10 | | }); |
10 | | - | |_________^ `*mut pyo3::Python<'static>` cannot be shared between threads safely |
11 | | - | |
12 | | - = help: within `pyo3::Bound<'_, PyString>`, the trait `Sync` is not implemented for `*mut pyo3::Python<'static>` |
| 3 | + | |
| 4 | + 8 | py.detach(|| { |
| 5 | + | ____________------_^ |
| 6 | + | | | |
| 7 | + | | required by a bound introduced by this call |
| 8 | + 9 | | println!("{:?}", string); |
| 9 | + 10 | | }); |
| 10 | + | |_________^ `*mut pyo3::Python<'static>` cannot be shared between threads safely |
| 11 | + | |
| 12 | + = help: within `pyo3::Bound<'_, PyString>`, the trait `Sync` is not implemented for `*mut pyo3::Python<'static>` |
13 | 13 | note: required because it appears within the type `PhantomData<*mut pyo3::Python<'static>>` |
14 | 14 | --> $RUST/core/src/marker.rs |
15 | | - | |
16 | | - | pub struct PhantomData<T: PointeeSized>; |
17 | | - | ^^^^^^^^^^^ |
| 15 | + | |
| 16 | + | pub struct PhantomData<T: PointeeSized>; |
| 17 | + | ^^^^^^^^^^^ |
18 | 18 | note: required because it appears within the type `pyo3::marker::NotSend` |
19 | 19 | --> src/marker.rs |
20 | | - | |
21 | | - | struct NotSend(PhantomData<*mut Python<'static>>); |
22 | | - | ^^^^^^^ |
| 20 | + | |
| 21 | + | struct NotSend(PhantomData<*mut Python<'static>>); |
| 22 | + | ^^^^^^^ |
23 | 23 | note: required because it appears within the type `PhantomData<pyo3::marker::NotSend>` |
24 | 24 | --> $RUST/core/src/marker.rs |
25 | | - | |
26 | | - | pub struct PhantomData<T: PointeeSized>; |
27 | | - | ^^^^^^^^^^^ |
| 25 | + | |
| 26 | + | pub struct PhantomData<T: PointeeSized>; |
| 27 | + | ^^^^^^^^^^^ |
28 | 28 | note: required because it appears within the type `pyo3::Python<'_>` |
29 | 29 | --> src/marker.rs |
30 | | - | |
31 | | - | pub struct Python<'py>(PhantomData<&'py AttachGuard>, PhantomData<NotSend>); |
32 | | - | ^^^^^^ |
| 30 | + | |
| 31 | + | pub struct Python<'py>(PhantomData<&'py AttachGuard>, PhantomData<NotSend>); |
| 32 | + | ^^^^^^ |
33 | 33 | note: required because it appears within the type `pyo3::Bound<'_, PyString>` |
34 | 34 | --> src/instance.rs |
35 | | - | |
36 | | - | pub struct Bound<'py, T>(Python<'py>, ManuallyDrop<Py<T>>); |
37 | | - | ^^^^^ |
38 | | - = note: required for `&pyo3::Bound<'_, PyString>` to implement `Send` |
| 35 | + | |
| 36 | + | pub struct Bound<'py, T>(Python<'py>, ManuallyDrop<Py<T>>); |
| 37 | + | ^^^^^ |
| 38 | + = note: required for `&pyo3::Bound<'_, PyString>` to implement `Send` |
39 | 39 | note: required because it's used within this closure |
40 | 40 | --> tests/ui/not_send2.rs:8:19 |
41 | | - | |
42 | | - 8 | py.detach(|| { |
43 | | - | ^^ |
44 | | - = note: required for `{closure@$DIR/tests/ui/not_send2.rs:8:19: 8:21}` to implement `Ungil` |
| 41 | + | |
| 42 | + 8 | py.detach(|| { |
| 43 | + | ^^ |
| 44 | + = note: required for `{closure@$DIR/tests/ui/not_send2.rs:8:19: 8:21}` to implement `Ungil` |
45 | 45 | note: required by a bound in `pyo3::Python::<'py>::detach` |
46 | 46 | --> src/marker.rs |
47 | | - | |
48 | | - | pub fn detach<T, F>(self, f: F) -> T |
49 | | - | ------ required by a bound in this associated function |
50 | | - | where |
51 | | - | F: Ungil + FnOnce() -> T, |
52 | | - | ^^^^^ required by this bound in `Python::<'py>::detach` |
| 47 | + | |
| 48 | + | pub fn detach<T, F>(self, f: F) -> T |
| 49 | + | ------ required by a bound in this associated function |
| 50 | + | where |
| 51 | + | F: Ungil + FnOnce() -> T, |
| 52 | + | ^^^^^ required by this bound in `Python::<'py>::detach` |
0 commit comments