Skip to content

Commit 00e8225

Browse files
test: bless ui tests
1 parent abdb347 commit 00e8225

3 files changed

Lines changed: 50 additions & 38 deletions

File tree

tests/ui/invalid_result_conversion.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ error[E0277]: the trait bound `PyErr: From<MyError>` is not satisfied
99
`PyErr` implements `From<CastError<'_, '_>>`
1010
`PyErr` implements `From<CastIntoError<'_>>`
1111
`PyErr` implements `From<CharTryFromError>`
12-
`PyErr` implements `From<DowncastError<'_, '_>>`
13-
`PyErr` implements `From<DowncastIntoError<'_>>`
1412
`PyErr` implements `From<FromUtf8Error>`
1513
`PyErr` implements `From<Infallible>`
14+
`PyErr` implements `From<IntoInnerError<W>>`
15+
`PyErr` implements `From<IntoStringError>`
1616
and $N others
1717
= note: required for `MyError` to implement `Into<PyErr>`

tests/ui/not_send.stderr

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0277]: `*mut pyo3::Python<'static>` cannot be shared between threads safely
2-
--> tests/ui/not_send.rs:4:15
2+
--> tests/ui/not_send.rs:4:15
33
|
44
4 | py.detach(|| { drop(py); });
55
| ------ ^^^^^^^^^^^^^^^^ `*mut pyo3::Python<'static>` cannot be shared between threads safely
@@ -8,28 +8,34 @@ error[E0277]: `*mut pyo3::Python<'static>` cannot be shared between threads safe
88
|
99
= help: within `pyo3::Python<'_>`, the trait `Sync` is not implemented for `*mut pyo3::Python<'static>`
1010
note: required because it appears within the type `PhantomData<*mut pyo3::Python<'static>>`
11-
--> $RUST/core/src/marker.rs
11+
--> $RUST/core/src/marker.rs
12+
|
13+
| pub struct PhantomData<T: PointeeSized>;
14+
| ^^^^^^^^^^^
1215
note: required because it appears within the type `pyo3::marker::NotSend`
13-
--> src/marker.rs
16+
--> src/marker.rs
1417
|
1518
| struct NotSend(PhantomData<*mut Python<'static>>);
1619
| ^^^^^^^
1720
note: required because it appears within the type `PhantomData<pyo3::marker::NotSend>`
18-
--> $RUST/core/src/marker.rs
21+
--> $RUST/core/src/marker.rs
22+
|
23+
| pub struct PhantomData<T: PointeeSized>;
24+
| ^^^^^^^^^^^
1925
note: required because it appears within the type `pyo3::Python<'_>`
20-
--> src/marker.rs
26+
--> src/marker.rs
2127
|
2228
| pub struct Python<'py>(PhantomData<&'py AttachGuard>, PhantomData<NotSend>);
2329
| ^^^^^^
2430
= note: required for `&pyo3::Python<'_>` to implement `Send`
2531
note: required because it's used within this closure
26-
--> tests/ui/not_send.rs:4:15
32+
--> tests/ui/not_send.rs:4:15
2733
|
2834
4 | py.detach(|| { drop(py); });
2935
| ^^
3036
= note: required for `{closure@$DIR/tests/ui/not_send.rs:4:15: 4:17}` to implement `Ungil`
3137
note: required by a bound in `pyo3::Python::<'py>::detach`
32-
--> src/marker.rs
38+
--> src/marker.rs
3339
|
3440
| pub fn detach<T, F>(self, f: F) -> T
3541
| ------ required by a bound in this associated function

tests/ui/not_send2.stderr

Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,52 @@
11
error[E0277]: `*mut pyo3::Python<'static>` cannot be shared between threads safely
22
--> 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);
3+
|
4+
8 | py.detach(|| {
5+
| ____________------_^
6+
| | |
7+
| | required by a bound introduced by this call
8+
9 | | println!("{:?}", string);
99
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>`
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>`
1313
note: required because it appears within the type `PhantomData<*mut pyo3::Python<'static>>`
1414
--> $RUST/core/src/marker.rs
15+
|
16+
| pub struct PhantomData<T: PointeeSized>;
17+
| ^^^^^^^^^^^
1518
note: required because it appears within the type `pyo3::marker::NotSend`
1619
--> src/marker.rs
17-
|
18-
| struct NotSend(PhantomData<*mut Python<'static>>);
19-
| ^^^^^^^
20+
|
21+
| struct NotSend(PhantomData<*mut Python<'static>>);
22+
| ^^^^^^^
2023
note: required because it appears within the type `PhantomData<pyo3::marker::NotSend>`
2124
--> $RUST/core/src/marker.rs
25+
|
26+
| pub struct PhantomData<T: PointeeSized>;
27+
| ^^^^^^^^^^^
2228
note: required because it appears within the type `pyo3::Python<'_>`
2329
--> src/marker.rs
24-
|
25-
| pub struct Python<'py>(PhantomData<&'py AttachGuard>, PhantomData<NotSend>);
26-
| ^^^^^^
30+
|
31+
| pub struct Python<'py>(PhantomData<&'py AttachGuard>, PhantomData<NotSend>);
32+
| ^^^^^^
2733
note: required because it appears within the type `pyo3::Bound<'_, PyString>`
2834
--> src/instance.rs
29-
|
30-
| pub struct Bound<'py, T>(Python<'py>, ManuallyDrop<Py<T>>);
31-
| ^^^^^
32-
= 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`
3339
note: required because it's used within this closure
3440
--> tests/ui/not_send2.rs:8:19
35-
|
36-
8 | py.detach(|| {
37-
| ^^
38-
= 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`
3945
note: required by a bound in `pyo3::Python::<'py>::detach`
4046
--> src/marker.rs
41-
|
42-
| pub fn detach<T, F>(self, f: F) -> T
43-
| ------ required by a bound in this associated function
44-
| where
45-
| F: Ungil + FnOnce() -> T,
46-
| ^^^^^ 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

Comments
 (0)