From 9a0b13534e3782417b04022908c2c672480d8b99 Mon Sep 17 00:00:00 2001 From: Icxolu <10486322+Icxolu@users.noreply.github.com> Date: Thu, 9 Jan 2025 18:04:58 +0100 Subject: [PATCH] update ui tests --- tests/ui/invalid_cancel_handle.stderr | 4 ++-- tests/ui/invalid_property_args.stderr | 2 +- tests/ui/invalid_pycallargs.stderr | 4 ++++ tests/ui/invalid_pyclass_args.stderr | 8 ++++---- tests/ui/invalid_pyfunctions.stderr | 2 +- tests/ui/invalid_pymethod_receiver.stderr | 2 +- tests/ui/invalid_pymethods.stderr | 2 +- tests/ui/not_send.stderr | 2 +- tests/ui/not_send2.stderr | 2 +- tests/ui/pyclass_send.stderr | 12 ++++++------ 10 files changed, 22 insertions(+), 18 deletions(-) diff --git a/tests/ui/invalid_cancel_handle.stderr b/tests/ui/invalid_cancel_handle.stderr index bd2b588df32..90a8caa4229 100644 --- a/tests/ui/invalid_cancel_handle.stderr +++ b/tests/ui/invalid_cancel_handle.stderr @@ -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<'_>` @@ -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 diff --git a/tests/ui/invalid_property_args.stderr b/tests/ui/invalid_property_args.stderr index f2fea2a1dd5..5ef01fa210a 100644 --- a/tests/ui/invalid_property_args.stderr +++ b/tests/ui/invalid_property_args.stderr @@ -52,7 +52,7 @@ error[E0277]: `PhantomData` cannot be converted to a Python object 45 | value: ::std::marker::PhantomData, | ^ required by `#[pyo3(get)]` to create a readable property from a field of type `PhantomData` | - = help: the trait `IntoPyObject<'_>` is not implemented for `PhantomData`, which is required by `for<'py> PhantomData: PyO3GetField<'py>` + = help: the trait `IntoPyObject<'_>` is not implemented for `PhantomData` = note: implement `IntoPyObject` for `&PhantomData` or `IntoPyObject + Clone` for `PhantomData` to define the conversion = help: the following other types implement trait `IntoPyObject<'py>`: &&'a T diff --git a/tests/ui/invalid_pycallargs.stderr b/tests/ui/invalid_pycallargs.stderr index 93c0bc19b7f..78867b6855a 100644 --- a/tests/ui/invalid_pycallargs.stderr +++ b/tests/ui/invalid_pycallargs.stderr @@ -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",)); + | + ++ diff --git a/tests/ui/invalid_pyclass_args.stderr b/tests/ui/invalid_pyclass_args.stderr index 15aa0387cc6..c13edc071d5 100644 --- a/tests/ui/invalid_pyclass_args.stderr +++ b/tests/ui/invalid_pyclass_args.stderr @@ -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 | diff --git a/tests/ui/invalid_pyfunctions.stderr b/tests/ui/invalid_pyfunctions.stderr index 271c5a806be..e48c522976a 100644 --- a/tests/ui/invalid_pyfunctions.stderr +++ b/tests/ui/invalid_pyfunctions.stderr @@ -44,7 +44,7 @@ error[E0277]: the trait bound `&str: From tests/ui/invalid_pyfunctions.rs:33:14 | 33 | _string: &str, - | ^ the trait `From>` is not implemented for `&str`, which is required by `BoundRef<'_, '_, pyo3::types::PyModule>: Into<_>` + | ^ the trait `From>` is not implemented for `&str` | = help: the following other types implement trait `From`: `String` implements `From<&String>` diff --git a/tests/ui/invalid_pymethod_receiver.stderr b/tests/ui/invalid_pymethod_receiver.stderr index 9c998403194..7d81c0fae91 100644 --- a/tests/ui/invalid_pymethod_receiver.stderr +++ b/tests/ui/invalid_pymethod_receiver.stderr @@ -2,7 +2,7 @@ error[E0277]: the trait bound `i32: TryFrom>` 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>` is not implemented for `i32`, which is required by `i32: TryFrom>` + | ^^^ the trait `From>` is not implemented for `i32` | = help: the following other types implement trait `From`: `i32` implements `From` diff --git a/tests/ui/invalid_pymethods.stderr b/tests/ui/invalid_pymethods.stderr index 845b79ed59a..eb8f429c937 100644 --- a/tests/ui/invalid_pymethods.stderr +++ b/tests/ui/invalid_pymethods.stderr @@ -183,7 +183,7 @@ error[E0277]: the trait bound `i32: From>` is not satis --> tests/ui/invalid_pymethods.rs:46:45 | 46 | fn classmethod_wrong_first_argument(_x: i32) -> Self { - | ^^^ the trait `From>` is not implemented for `i32`, which is required by `BoundRef<'_, '_, PyType>: Into<_>` + | ^^^ the trait `From>` is not implemented for `i32` | = help: the following other types implement trait `From`: `i32` implements `From` diff --git a/tests/ui/not_send.stderr b/tests/ui/not_send.stderr index 8007c2f4e54..5d05b3de059 100644 --- a/tests/ui/not_send.stderr +++ b/tests/ui/not_send.stderr @@ -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 | diff --git a/tests/ui/not_send2.stderr b/tests/ui/not_send2.stderr index 52a4e6a7208..eec2b644e9a 100644 --- a/tests/ui/not_send2.stderr +++ b/tests/ui/not_send2.stderr @@ -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 | diff --git a/tests/ui/pyclass_send.stderr b/tests/ui/pyclass_send.stderr index 516df060b13..1623a5b2183 100644 --- a/tests/ui/pyclass_send.stderr +++ b/tests/ui/pyclass_send.stderr @@ -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 | @@ -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: pyo3::impl_::pyclass::PyClassThreadChecker` + = help: within `NotSyncNotSend`, the trait `Send` is not implemented for `*mut c_void` = help: the trait `pyo3::impl_::pyclass::PyClassThreadChecker` is implemented for `SendablePyClass` note: required because it appears within the type `NotSyncNotSend` --> tests/ui/pyclass_send.rs:5:8 @@ -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 | @@ -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: pyo3::impl_::pyclass::PyClassThreadChecker` + = help: within `SyncNotSend`, the trait `Send` is not implemented for `*mut c_void` = help: the trait `pyo3::impl_::pyclass::PyClassThreadChecker` is implemented for `SendablePyClass` note: required because it appears within the type `SyncNotSend` --> tests/ui/pyclass_send.rs:12:8 @@ -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 | @@ -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 |