Skip to content

Commit

Permalink
test: fix ui tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Perez committed Oct 27, 2023
1 parent 92bff8a commit 5688d55
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions tests/ui/invalid_pyfunctions.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ error: Python functions cannot have `impl Trait` arguments
| ^^^^

error: wildcard argument names are not supported
--> tests/ui/invalid_pyfunctions.rs:13:22
--> tests/ui/invalid_pyfunctions.rs:10:22
|
9 | fn wildcard_argument(_: i32) {}
10 | fn wildcard_argument(_: i32) {}
| ^

error: destructuring in arguments is not supported
--> tests/ui/invalid_pyfunctions.rs:16:26
--> tests/ui/invalid_pyfunctions.rs:13:26
|
12 | fn destructured_argument((a, b): (i32, i32)) {}
13 | fn destructured_argument((a, b): (i32, i32)) {}
| ^^^^^^

error: required arguments after an `Option<_>` argument are ambiguous
= help: add a `#[pyo3(signature)]` annotation on this function to unambiguously specify the default values for all optional parameters
--> tests/ui/invalid_pyfunctions.rs:19:63
--> tests/ui/invalid_pyfunctions.rs:16:63
|
15 | fn function_with_required_after_option(_opt: Option<i32>, _x: i32) {}
16 | fn function_with_required_after_option(_opt: Option<i32>, _x: i32) {}
| ^^^
12 changes: 6 additions & 6 deletions tests/ui/invalid_pymethods.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -154,27 +154,27 @@ error: Python functions cannot have `impl Trait` arguments
| ^^^^

error: `pass_module` cannot be used on Python methods
--> tests/ui/invalid_pymethods.rs:171:12
--> tests/ui/invalid_pymethods.rs:166:12
|
166 | #[pyo3(pass_module)]
| ^^^^^^^^^^^

error: Python objects are shared, so 'self' cannot be moved out of the Python interpreter.
Try `&self`, `&mut self, `slf: PyRef<'_, Self>` or `slf: PyRefMut<'_, Self>`.
--> tests/ui/invalid_pymethods.rs:177:29
--> tests/ui/invalid_pymethods.rs:172:29
|
172 | fn method_self_by_value(self) {}
| ^^^^

error: macros cannot be used as items in `#[pymethods]` impl blocks
= note: this was previously accepted and ignored
--> tests/ui/invalid_pymethods.rs:212:5
--> tests/ui/invalid_pymethods.rs:207:5
|
207 | macro_invocation!();
| ^^^^^^^^^^^^^^^^

error[E0119]: conflicting implementations of trait `pyo3::impl_::pyclass::PyClassNewTextSignature<TwoNew>` for type `pyo3::impl_::pyclass::PyClassImplCollector<TwoNew>`
--> tests/ui/invalid_pymethods.rs:182:1
--> tests/ui/invalid_pymethods.rs:177:1
|
177 | #[pymethods]
| ^^^^^^^^^^^^
Expand All @@ -185,7 +185,7 @@ error[E0119]: conflicting implementations of trait `pyo3::impl_::pyclass::PyClas
= note: this error originates in the attribute macro `pymethods` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0592]: duplicate definitions with name `__pymethod___new____`
--> tests/ui/invalid_pymethods.rs:182:1
--> tests/ui/invalid_pymethods.rs:177:1
|
177 | #[pymethods]
| ^^^^^^^^^^^^
Expand All @@ -196,7 +196,7 @@ error[E0592]: duplicate definitions with name `__pymethod___new____`
= note: this error originates in the attribute macro `pymethods` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0592]: duplicate definitions with name `__pymethod_func__`
--> tests/ui/invalid_pymethods.rs:197:1
--> tests/ui/invalid_pymethods.rs:192:1
|
192 | #[pymethods]
| ^^^^^^^^^^^^
Expand Down

0 comments on commit 5688d55

Please sign in to comment.