Skip to content

Commit 968c8ee

Browse files
committed
ci: ui test updates
1 parent b8bb83b commit 968c8ee

9 files changed

+55
-39
lines changed

tests/ui/abi3_nativetype_inheritance.stderr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ error[E0277]: the trait bound `PyDict: PyClassBaseType` is not satisfied
55
| ^^^^^^ the trait `PyClass` is not implemented for `PyDict`, which is required by `PyDict: PyClassBaseType`
66
|
77
= note: with the `abi3` feature enabled, PyO3 does not support subclassing native types
8-
= help: the trait `PyClassBaseType` is implemented for `PyAny`
8+
= help: the following other types implement trait `PyClass`:
9+
TestClass
10+
pyo3::coroutine::Coroutine
911
= note: required for `PyDict` to implement `PyClassBaseType`
1012
note: required by a bound in `PyClassImpl::BaseType`
1113
--> src/impl_/pyclass.rs

tests/ui/invalid_cancel_handle.stderr

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ error[E0277]: the trait bound `CancelHandle: PyFunctionArgument<'_, '_>` is not
4444
20 | async fn missing_cancel_handle_attribute(_param: pyo3::coroutine::CancelHandle) {}
4545
| ^^^^ the trait `PyClass` is not implemented for `CancelHandle`, which is required by `CancelHandle: PyFunctionArgument<'_, '_>`
4646
|
47-
= help: the following other types implement trait `PyFunctionArgument<'a, 'py>`:
48-
&'a mut pyo3::coroutine::Coroutine
49-
&'a pyo3::Bound<'py, T>
50-
&'a pyo3::coroutine::Coroutine
51-
Option<&'a pyo3::Bound<'py, T>>
47+
= help: the trait `PyClass` is implemented for `pyo3::coroutine::Coroutine`
5248
= note: required for `CancelHandle` to implement `FromPyObject<'_>`
5349
= note: required for `CancelHandle` to implement `FromPyObjectBound<'_, '_>`
5450
= note: required for `CancelHandle` to implement `PyFunctionArgument<'_, '_>`

tests/ui/invalid_intern_arg.stderr

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ error[E0435]: attempt to use a non-constant value in a constant
22
--> tests/ui/invalid_intern_arg.rs:5:61
33
|
44
5 | Python::with_gil(|py| py.import_bound(pyo3::intern!(py, _foo)).unwrap());
5-
| ------------------^^^^-
6-
| | |
7-
| | non-constant value
8-
| help: consider using `let` instead of `static`: `let INTERNED`
5+
| ^^^^ non-constant value
6+
|
7+
help: consider using `let` instead of `static`
8+
--> src/sync.rs
9+
|
10+
| let INTERNED: $crate::sync::Interned = $crate::sync::Interned::new($text);
11+
| ~~~
912

1013
error: lifetime may not live long enough
1114
--> tests/ui/invalid_intern_arg.rs:5:27

tests/ui/invalid_property_args.stderr

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@ error[E0277]: `PhantomData<i32>` cannot be converted to a Python object
5454
|
5555
= help: the trait `IntoPy<Py<PyAny>>` is not implemented for `PhantomData<i32>`, which is required by `PhantomData<i32>: PyO3GetField`
5656
= note: implement `ToPyObject` or `IntoPy<PyObject> + Clone` for `PhantomData<i32>` to define the conversion
57+
= help: the following other types implement trait `IntoPy<T>`:
58+
`&'a OsString` implements `IntoPy<Py<PyAny>>`
59+
`&'a Path` implements `IntoPy<Py<PyAny>>`
60+
`&'a PathBuf` implements `IntoPy<Py<PyAny>>`
61+
`&'a PyErr` implements `IntoPy<Py<PyAny>>`
62+
`&'a String` implements `IntoPy<Py<PyAny>>`
63+
`&'a [u8]` implements `IntoPy<Py<PyAny>>`
64+
`&'a str` implements `IntoPy<Py<PyAny>>`
65+
`&'a str` implements `IntoPy<Py<PyString>>`
66+
and $N others
5767
= note: required for `PhantomData<i32>` to implement `PyO3GetField`
5868
note: required by a bound in `PyClassGetterGenerator::<ClassT, FieldT, Offset, false, false>::generate`
5969
--> src/impl_/pyclass.rs

tests/ui/invalid_pyfunctions.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ error[E0277]: the trait bound `&str: From<BoundRef<'_, '_, pyo3::types::PyModule
5454
| ^ the trait `From<BoundRef<'_, '_, pyo3::types::PyModule>>` is not implemented for `&str`, which is required by `BoundRef<'_, '_, pyo3::types::PyModule>: Into<_>`
5555
|
5656
= help: the following other types implement trait `From<T>`:
57-
<String as From<&String>>
58-
<String as From<&mut str>>
59-
<String as From<&str>>
60-
<String as From<Box<str>>>
61-
<String as From<Cow<'a, str>>>
62-
<String as From<char>>
57+
`String` implements `From<&String>`
58+
`String` implements `From<&mut str>`
59+
`String` implements `From<&str>`
60+
`String` implements `From<Box<str>>`
61+
`String` implements `From<Cow<'a, str>>`
62+
`String` implements `From<char>`
6363
= note: required for `BoundRef<'_, '_, pyo3::types::PyModule>` to implement `Into<&str>`

tests/ui/invalid_pymethod_receiver.stderr

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ error[E0277]: the trait bound `i32: TryFrom<BoundRef<'_, '_, MyClass>>` is not s
55
| ^^^ the trait `From<BoundRef<'_, '_, MyClass>>` is not implemented for `i32`, which is required by `i32: TryFrom<BoundRef<'_, '_, MyClass>>`
66
|
77
= help: the following other types implement trait `From<T>`:
8-
<i32 as From<bool>>
9-
<i32 as From<i16>>
10-
<i32 as From<i8>>
11-
<i32 as From<u16>>
12-
<i32 as From<u8>>
13-
<i32 as From<zerocopy::byteorder::I16<O>>>
14-
<i32 as From<zerocopy::byteorder::I32<O>>>
8+
`i32` implements `From<bool>`
9+
`i32` implements `From<i16>`
10+
`i32` implements `From<i8>`
11+
`i32` implements `From<u16>`
12+
`i32` implements `From<u8>`
1513
= note: required for `BoundRef<'_, '_, MyClass>` to implement `Into<i32>`
1614
= note: required for `i32` to implement `TryFrom<BoundRef<'_, '_, MyClass>>`

tests/ui/invalid_pymethods.stderr

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,9 @@ error[E0277]: the trait bound `i32: From<BoundRef<'_, '_, PyType>>` is not satis
186186
| ^^^ the trait `From<BoundRef<'_, '_, PyType>>` is not implemented for `i32`, which is required by `BoundRef<'_, '_, PyType>: Into<_>`
187187
|
188188
= help: the following other types implement trait `From<T>`:
189-
<i32 as From<bool>>
190-
<i32 as From<i16>>
191-
<i32 as From<i8>>
192-
<i32 as From<u16>>
193-
<i32 as From<u8>>
194-
<i32 as From<zerocopy::byteorder::I16<O>>>
195-
<i32 as From<zerocopy::byteorder::I32<O>>>
189+
`i32` implements `From<bool>`
190+
`i32` implements `From<i16>`
191+
`i32` implements `From<i8>`
192+
`i32` implements `From<u16>`
193+
`i32` implements `From<u8>`
196194
= note: required for `BoundRef<'_, '_, PyType>` to implement `Into<i32>`

tests/ui/invalid_result_conversion.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ error[E0277]: the trait bound `PyErr: From<MyError>` is not satisfied
55
| ^^^^^^ the trait `From<MyError>` is not implemented for `PyErr`, which is required by `MyError: Into<PyErr>`
66
|
77
= help: the following other types implement trait `From<T>`:
8-
<PyErr as From<AddrParseError>>
9-
<PyErr as From<DecodeUtf16Error>>
10-
<PyErr as From<DowncastError<'_, '_>>>
11-
<PyErr as From<DowncastIntoError<'_>>>
12-
<PyErr as From<FromUtf16Error>>
13-
<PyErr as From<FromUtf8Error>>
14-
<PyErr as From<Infallible>>
15-
<PyErr as From<IntoInnerError<W>>>
8+
`PyErr` implements `From<AddrParseError>`
9+
`PyErr` implements `From<DecodeUtf16Error>`
10+
`PyErr` implements `From<DowncastError<'_, '_>>`
11+
`PyErr` implements `From<DowncastIntoError<'_>>`
12+
`PyErr` implements `From<FromUtf16Error>`
13+
`PyErr` implements `From<FromUtf8Error>`
14+
`PyErr` implements `From<Infallible>`
15+
`PyErr` implements `From<IntoInnerError<W>>`
1616
and $N others
1717
= note: required for `MyError` to implement `Into<PyErr>`

tests/ui/missing_intopy.stderr

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,14 @@ error[E0277]: `Blah` cannot be converted to a Python object
77
= note: `IntoPy` is automatically implemented by the `#[pyclass]` macro
88
= note: if you do not wish to have a corresponding Python type, implement `IntoPy` manually
99
= note: if you do not own `Blah` you can perform a manual conversion to one of the types in `pyo3::types::*`
10-
= help: the trait `OkWrap<T>` is implemented for `Result<T, E>`
10+
= help: the following other types implement trait `IntoPy<T>`:
11+
`&'a OsString` implements `IntoPy<Py<PyAny>>`
12+
`&'a Path` implements `IntoPy<Py<PyAny>>`
13+
`&'a PathBuf` implements `IntoPy<Py<PyAny>>`
14+
`&'a PyErr` implements `IntoPy<Py<PyAny>>`
15+
`&'a String` implements `IntoPy<Py<PyAny>>`
16+
`&'a [u8]` implements `IntoPy<Py<PyAny>>`
17+
`&'a str` implements `IntoPy<Py<PyAny>>`
18+
`&'a str` implements `IntoPy<Py<PyString>>`
19+
and $N others
1120
= note: required for `Blah` to implement `OkWrap<Blah>`

0 commit comments

Comments
 (0)