Skip to content

Commit

Permalink
update ui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Icxolu committed Jan 9, 2025
1 parent ef59c9a commit 9a0b135
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 18 deletions.
4 changes: 2 additions & 2 deletions tests/ui/invalid_cancel_handle.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ error[E0277]: the trait bound `CancelHandle: PyFunctionArgument<'_, '_>` is not
--> tests/ui/invalid_cancel_handle.rs:20:50
|
20 | async fn missing_cancel_handle_attribute(_param: pyo3::coroutine::CancelHandle) {}
| ^^^^ the trait `PyClass` is not implemented for `CancelHandle`, which is required by `CancelHandle: PyFunctionArgument<'_, '_>`
| ^^^^ the trait `PyClass` is not implemented for `CancelHandle`
|
= help: the trait `PyClass` is implemented for `pyo3::coroutine::Coroutine`
= note: required for `CancelHandle` to implement `FromPyObject<'_>`
Expand All @@ -61,7 +61,7 @@ error[E0277]: the trait bound `CancelHandle: PyFunctionArgument<'_, '_>` is not
--> tests/ui/invalid_cancel_handle.rs:20:50
|
20 | async fn missing_cancel_handle_attribute(_param: pyo3::coroutine::CancelHandle) {}
| ^^^^ the trait `Clone` is not implemented for `CancelHandle`, which is required by `CancelHandle: PyFunctionArgument<'_, '_>`
| ^^^^ the trait `Clone` is not implemented for `CancelHandle`
|
= help: the following other types implement trait `PyFunctionArgument<'a, 'py>`:
&'a mut pyo3::coroutine::Coroutine
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/invalid_property_args.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ error[E0277]: `PhantomData<i32>` cannot be converted to a Python object
45 | value: ::std::marker::PhantomData<i32>,
| ^ required by `#[pyo3(get)]` to create a readable property from a field of type `PhantomData<i32>`
|
= help: the trait `IntoPyObject<'_>` is not implemented for `PhantomData<i32>`, which is required by `for<'py> PhantomData<i32>: PyO3GetField<'py>`
= help: the trait `IntoPyObject<'_>` is not implemented for `PhantomData<i32>`
= note: implement `IntoPyObject` for `&PhantomData<i32>` or `IntoPyObject + Clone` for `PhantomData<i32>` to define the conversion
= help: the following other types implement trait `IntoPyObject<'py>`:
&&'a T
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/invalid_pycallargs.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ note: required by a bound in `call1`
| where
| A: PyCallArgs<'py>;
| ^^^^^^^^^^^^^^^ required by this bound in `PyAnyMethods::call1`
help: use a unary tuple instead
|
6 | any.call1(("foo",));
| + ++
8 changes: 4 additions & 4 deletions tests/ui/invalid_pyclass_args.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,21 @@ error: expected one of: `get`, `set`, `name`
85 | #[pyo3(pop)]
| ^^^

error: invalid format string: expected `'}'` but string was terminated
error: invalid format string: expected `}` but string was terminated
--> tests/ui/invalid_pyclass_args.rs:105:19
|
105 | #[pyclass(str = "{")]
| -^ expected `'}'` in format string
| -^ expected `}` in format string
| |
| because of this opening brace
|
= note: if you intended to print `{`, you can escape it using `{{`

error: invalid format string: expected `'}'`, found `'$'`
error: invalid format string: expected `}`, found `$`
--> tests/ui/invalid_pyclass_args.rs:109:19
|
109 | #[pyclass(str = "{$}")]
| -^ expected `'}'` in format string
| -^ expected `}` in format string
| |
| because of this opening brace
|
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/invalid_pyfunctions.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ error[E0277]: the trait bound `&str: From<BoundRef<'_, '_, pyo3::types::PyModule
--> tests/ui/invalid_pyfunctions.rs:33:14
|
33 | _string: &str,
| ^ the trait `From<BoundRef<'_, '_, pyo3::types::PyModule>>` is not implemented for `&str`, which is required by `BoundRef<'_, '_, pyo3::types::PyModule>: Into<_>`
| ^ the trait `From<BoundRef<'_, '_, pyo3::types::PyModule>>` is not implemented for `&str`
|
= help: the following other types implement trait `From<T>`:
`String` implements `From<&String>`
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/invalid_pymethod_receiver.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0277]: the trait bound `i32: TryFrom<BoundRef<'_, '_, MyClass>>` is not s
--> tests/ui/invalid_pymethod_receiver.rs:8:44
|
8 | fn method_with_invalid_self_type(_slf: i32, _py: Python<'_>, _index: u32) {}
| ^^^ the trait `From<BoundRef<'_, '_, MyClass>>` is not implemented for `i32`, which is required by `i32: TryFrom<BoundRef<'_, '_, MyClass>>`
| ^^^ the trait `From<BoundRef<'_, '_, MyClass>>` is not implemented for `i32`
|
= help: the following other types implement trait `From<T>`:
`i32` implements `From<bool>`
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/invalid_pymethods.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ error[E0277]: the trait bound `i32: From<BoundRef<'_, '_, PyType>>` is not satis
--> tests/ui/invalid_pymethods.rs:46:45
|
46 | fn classmethod_wrong_first_argument(_x: i32) -> Self {
| ^^^ the trait `From<BoundRef<'_, '_, PyType>>` is not implemented for `i32`, which is required by `BoundRef<'_, '_, PyType>: Into<_>`
| ^^^ the trait `From<BoundRef<'_, '_, PyType>>` is not implemented for `i32`
|
= help: the following other types implement trait `From<T>`:
`i32` implements `From<bool>`
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/not_send.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ error[E0277]: `*mut pyo3::Python<'static>` cannot be shared between threads safe
| |
| required by a bound introduced by this call
|
= help: within `pyo3::Python<'_>`, the trait `Sync` is not implemented for `*mut pyo3::Python<'static>`, which is required by `{closure@$DIR/tests/ui/not_send.rs:4:22: 4:24}: Ungil`
= help: within `pyo3::Python<'_>`, the trait `Sync` is not implemented for `*mut pyo3::Python<'static>`
note: required because it appears within the type `PhantomData<*mut pyo3::Python<'static>>`
--> $RUST/core/src/marker.rs
|
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/not_send2.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ error[E0277]: `*mut pyo3::Python<'static>` cannot be shared between threads safe
10 | | });
| |_________^ `*mut pyo3::Python<'static>` cannot be shared between threads safely
|
= 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`
= help: within `pyo3::Bound<'_, PyString>`, the trait `Sync` is not implemented for `*mut pyo3::Python<'static>`
note: required because it appears within the type `PhantomData<*mut pyo3::Python<'static>>`
--> $RUST/core/src/marker.rs
|
Expand Down
12 changes: 6 additions & 6 deletions tests/ui/pyclass_send.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0277]: `*mut c_void` cannot be shared between threads safely
5 | struct NotSyncNotSend(*mut c_void);
| ^^^^^^^^^^^^^^ `*mut c_void` cannot be shared between threads safely
|
= help: within `NotSyncNotSend`, the trait `Sync` is not implemented for `*mut c_void`, which is required by `NotSyncNotSend: Sync`
= help: within `NotSyncNotSend`, the trait `Sync` is not implemented for `*mut c_void`
note: required because it appears within the type `NotSyncNotSend`
--> tests/ui/pyclass_send.rs:5:8
|
Expand All @@ -25,7 +25,7 @@ error[E0277]: `*mut c_void` cannot be sent between threads safely
4 | #[pyclass]
| ^^^^^^^^^^ `*mut c_void` cannot be sent between threads safely
|
= help: within `NotSyncNotSend`, the trait `Send` is not implemented for `*mut c_void`, which is required by `SendablePyClass<NotSyncNotSend>: pyo3::impl_::pyclass::PyClassThreadChecker<NotSyncNotSend>`
= help: within `NotSyncNotSend`, the trait `Send` is not implemented for `*mut c_void`
= help: the trait `pyo3::impl_::pyclass::PyClassThreadChecker<T>` is implemented for `SendablePyClass<T>`
note: required because it appears within the type `NotSyncNotSend`
--> tests/ui/pyclass_send.rs:5:8
Expand All @@ -46,7 +46,7 @@ error[E0277]: `*mut c_void` cannot be shared between threads safely
8 | struct SendNotSync(*mut c_void);
| ^^^^^^^^^^^ `*mut c_void` cannot be shared between threads safely
|
= help: within `SendNotSync`, the trait `Sync` is not implemented for `*mut c_void`, which is required by `SendNotSync: Sync`
= help: within `SendNotSync`, the trait `Sync` is not implemented for `*mut c_void`
note: required because it appears within the type `SendNotSync`
--> tests/ui/pyclass_send.rs:8:8
|
Expand All @@ -67,7 +67,7 @@ error[E0277]: `*mut c_void` cannot be sent between threads safely
11 | #[pyclass]
| ^^^^^^^^^^ `*mut c_void` cannot be sent between threads safely
|
= help: within `SyncNotSend`, the trait `Send` is not implemented for `*mut c_void`, which is required by `SendablePyClass<SyncNotSend>: pyo3::impl_::pyclass::PyClassThreadChecker<SyncNotSend>`
= help: within `SyncNotSend`, the trait `Send` is not implemented for `*mut c_void`
= help: the trait `pyo3::impl_::pyclass::PyClassThreadChecker<T>` is implemented for `SendablePyClass<T>`
note: required because it appears within the type `SyncNotSend`
--> tests/ui/pyclass_send.rs:12:8
Expand All @@ -88,7 +88,7 @@ error[E0277]: `*mut c_void` cannot be sent between threads safely
4 | #[pyclass]
| ^^^^^^^^^^ `*mut c_void` cannot be sent between threads safely
|
= help: within `NotSyncNotSend`, the trait `Send` is not implemented for `*mut c_void`, which is required by `NotSyncNotSend: Send`
= help: within `NotSyncNotSend`, the trait `Send` is not implemented for `*mut c_void`
note: required because it appears within the type `NotSyncNotSend`
--> tests/ui/pyclass_send.rs:5:8
|
Expand All @@ -107,7 +107,7 @@ error[E0277]: `*mut c_void` cannot be sent between threads safely
11 | #[pyclass]
| ^^^^^^^^^^ `*mut c_void` cannot be sent between threads safely
|
= help: within `SyncNotSend`, the trait `Send` is not implemented for `*mut c_void`, which is required by `SyncNotSend: Send`
= help: within `SyncNotSend`, the trait `Send` is not implemented for `*mut c_void`
note: required because it appears within the type `SyncNotSend`
--> tests/ui/pyclass_send.rs:12:8
|
Expand Down

0 comments on commit 9a0b135

Please sign in to comment.