Skip to content

Commit

Permalink
Bless ui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Mar 31, 2022
1 parent e557025 commit cb1ece7
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion tests/ui/invalid_pyfunctions.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ error: Python functions cannot have `impl Trait` arguments

error: `async fn` is not yet supported for Python functions.

Additional crates such as `pyo3-asyncio` can be used to integrate async Rust and Python. For more information, see https://github.com/PyO3/pyo3/issues/1632
Additional crates such as `pyo3-asyncio` can be used to integrate async Rust and Python. For more information, see https://github.com/PyO3/pyo3/issues/1632
--> tests/ui/invalid_pyfunctions.rs:10:1
|
10 | async fn async_function() {}
Expand Down
31 changes: 13 additions & 18 deletions tests/ui/invalid_pymethod_receiver.stderr
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
error[E0277]: the trait bound `i32: From<&PyCell<MyClass>>` is not satisfied
--> tests/ui/invalid_pymethod_receiver.rs:8:43
|
8 | fn method_with_invalid_self_type(slf: i32, py: Python, index: u32) {}
| ^^^ the trait `From<&PyCell<MyClass>>` is not implemented for `i32`
|
= help: the following implementations were found:
<i32 as From<NonZeroI32>>
<i32 as From<bool>>
<i32 as From<i16>>
<i32 as From<i8>>
and 2 others
= note: required because of the requirements on the impl of `Into<i32>` for `&PyCell<MyClass>`
= note: required because of the requirements on the impl of `TryFrom<&PyCell<MyClass>>` for `i32`
note: required by `std::convert::TryFrom::try_from`
--> $RUST/core/src/convert/mod.rs
|
| fn try_from(value: T) -> Result<Self, Self::Error>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
--> tests/ui/invalid_pymethod_receiver.rs:8:43
|
8 | fn method_with_invalid_self_type(slf: i32, py: Python, index: u32) {}
| ^^^ the trait `From<&PyCell<MyClass>>` is not implemented for `i32`
|
= help: the following implementations were found:
<i32 as From<NonZeroI32>>
<i32 as From<bool>>
<i32 as From<i16>>
<i32 as From<i8>>
and 2 others
= note: required because of the requirements on the impl of `Into<i32>` for `&PyCell<MyClass>`
= note: required because of the requirements on the impl of `TryFrom<&PyCell<MyClass>>` for `i32`
2 changes: 1 addition & 1 deletion tests/ui/invalid_pymethods.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ error: Python functions cannot have `impl Trait` arguments

error: `async fn` is not yet supported for Python functions.

Additional crates such as `pyo3-asyncio` can be used to integrate async Rust and Python. For more information, see https://github.com/PyO3/pyo3/issues/1632
Additional crates such as `pyo3-asyncio` can be used to integrate async Rust and Python. For more information, see https://github.com/PyO3/pyo3/issues/1632
--> tests/ui/invalid_pymethods.rs:107:5
|
107 | async fn async_method(&self) {}
Expand Down
17 changes: 11 additions & 6 deletions tests/ui/missing_clone.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
error[E0277]: the trait bound `TestClass: Clone` is not satisfied
--> tests/ui/missing_clone.rs:15:32
|
15 | let t: TestClass = pyvalue.extract(py).unwrap();
| ^^^^^^^ the trait `Clone` is not implemented for `TestClass`
|
= note: required because of the requirements on the impl of `pyo3::FromPyObject<'_>` for `TestClass`
--> tests/ui/missing_clone.rs:15:32
|
15 | let t: TestClass = pyvalue.extract(py).unwrap();
| ^^^^^^^ the trait `Clone` is not implemented for `TestClass`
|
= note: required because of the requirements on the impl of `pyo3::FromPyObject<'_>` for `TestClass`
note: required by a bound in `pyo3::Py::<T>::extract`
--> src/instance.rs:518:12
|
518 | D: FromPyObject<'p>,
| ^^^^^^^^^^^^^^^^ required by this bound in `pyo3::Py::<T>::extract`
2 changes: 1 addition & 1 deletion tests/ui/static_ref.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'py`
4 | #[pyfunction]
| ^^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the body at 4:1...
note: first, the lifetime cannot outlive the anonymous lifetime #1 defined here...
--> tests/ui/static_ref.rs:4:1
|
4 | #[pyfunction]
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/wrong_aspyref_lifetimes.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ error[E0505]: cannot move out of `gil` because it is borrowed
--> tests/ui/wrong_aspyref_lifetimes.rs:7:10
|
6 | let dict: &PyDict = dict.as_ref(gil.python());
| --- borrow of `gil` occurs here
| ------------ borrow of `gil` occurs here
7 | drop(gil);
| ^^^ move out of `gil` occurs here
8 |
9 | let _py: Python = dict.py(); // Obtain a Python<'p> without GIL.
| ---- borrow later used here
| --------- borrow later used here

0 comments on commit cb1ece7

Please sign in to comment.