Skip to content

Commit

Permalink
Fix abi3 inheritance UI test
Browse files Browse the repository at this point in the history
  • Loading branch information
ChayimFriedman2 committed Aug 22, 2024
1 parent 79d227e commit 7de5019
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 16 deletions.
17 changes: 10 additions & 7 deletions tests/ui/abi3_inheritance.stderr
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
error[E0277]: the trait bound `PyException: PyClassBaseType` is not satisfied
error[E0277]: pyclass `PyException` cannot be subclassed
--> tests/ui/abi3_inheritance.rs:4:19
|
4 | #[pyclass(extends=PyException)]
| ^^^^^^^^^^^ the trait `PyClass` is not implemented for `PyException`, which is required by `PyException: PyClassBaseType`
| ^^^^^^^^^^^ required for `#[pyclass(extends=PyException)]`
|
= help: the trait `PyClassBaseType` is not implemented for `PyException`
= note: if you own `PyException`, add `subclass` to the `#[pyclass]` macro: `#[pyclass(subclass)]`
= note: with the `abi3` feature enabled, PyO3 does not support subclassing native types
= help: the trait `PyClassBaseType` is implemented for `PyAny`
= note: required for `PyException` to implement `PyClassBaseType`
note: required by a bound in `PyClassImpl::BaseType`
--> src/impl_/pyclass.rs
|
| type BaseType: PyTypeInfo + PyClassBaseType;
| ^^^^^^^^^^^^^^^ required by this bound in `PyClassImpl::BaseType`

error[E0277]: the trait bound `PyException: PyClass` is not satisfied
error[E0277]: pyclass `PyException` cannot be subclassed
--> tests/ui/abi3_inheritance.rs:4:1
|
4 | #[pyclass(extends=PyException)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `PyClass` is not implemented for `PyException`, which is required by `PyException: PyClassBaseType`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required for `#[pyclass(extends=PyException)]`
|
= help: the trait `PyClass` is implemented for `MyException`
= note: required for `PyException` to implement `PyClassBaseType`
= help: the trait `PyClassBaseType` is not implemented for `PyException`
= note: if you own `PyException`, add `subclass` to the `#[pyclass]` macro: `#[pyclass(subclass)]`
= note: with the `abi3` feature enabled, PyO3 does not support subclassing native types
= help: the trait `PyClassBaseType` is implemented for `PyAny`
= note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)
19 changes: 10 additions & 9 deletions tests/ui/abi3_nativetype_inheritance.stderr
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
error[E0277]: the trait bound `PyDict: PyClassBaseType` is not satisfied
error[E0277]: pyclass `PyDict` cannot be subclassed
--> tests/ui/abi3_nativetype_inheritance.rs:5:19
|
5 | #[pyclass(extends=PyDict)]
| ^^^^^^ the trait `PyClass` is not implemented for `PyDict`, which is required by `PyDict: PyClassBaseType`
| ^^^^^^ required for `#[pyclass(extends=PyDict)]`
|
= help: the trait `PyClassBaseType` is not implemented for `PyDict`
= note: if you own `PyDict`, add `subclass` to the `#[pyclass]` macro: `#[pyclass(subclass)]`
= note: with the `abi3` feature enabled, PyO3 does not support subclassing native types
= help: the trait `PyClassBaseType` is implemented for `PyAny`
= note: required for `PyDict` to implement `PyClassBaseType`
note: required by a bound in `PyClassImpl::BaseType`
--> src/impl_/pyclass.rs
|
| type BaseType: PyTypeInfo + PyClassBaseType;
| ^^^^^^^^^^^^^^^ required by this bound in `PyClassImpl::BaseType`

error[E0277]: the trait bound `PyDict: PyClass` is not satisfied
error[E0277]: pyclass `PyDict` cannot be subclassed
--> tests/ui/abi3_nativetype_inheritance.rs:5:1
|
5 | #[pyclass(extends=PyDict)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `PyClass` is not implemented for `PyDict`, which is required by `PyDict: PyClassBaseType`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ required for `#[pyclass(extends=PyDict)]`
|
= help: the following other types implement trait `PyClass`:
TestClass
pyo3::coroutine::Coroutine
= note: required for `PyDict` to implement `PyClassBaseType`
= help: the trait `PyClassBaseType` is not implemented for `PyDict`
= note: if you own `PyDict`, add `subclass` to the `#[pyclass]` macro: `#[pyclass(subclass)]`
= note: with the `abi3` feature enabled, PyO3 does not support subclassing native types
= help: the trait `PyClassBaseType` is implemented for `PyAny`
= note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)

0 comments on commit 7de5019

Please sign in to comment.