diff --git a/pyo3-ffi/src/structmember.rs b/pyo3-ffi/src/structmember.rs index 2d9dd5a4a1f..4aa6c24db4f 100644 --- a/pyo3-ffi/src/structmember.rs +++ b/pyo3-ffi/src/structmember.rs @@ -2,6 +2,8 @@ use std::ffi::c_int; pub use crate::PyMemberDef; +#[allow(deprecated)] +pub use crate::_Py_T_OBJECT as T_OBJECT; pub use crate::Py_T_BOOL as T_BOOL; pub use crate::Py_T_BYTE as T_BYTE; pub use crate::Py_T_CHAR as T_CHAR; @@ -19,12 +21,10 @@ pub use crate::Py_T_UINT as T_UINT; pub use crate::Py_T_ULONG as T_ULONG; pub use crate::Py_T_ULONGLONG as T_ULONGLONG; pub use crate::Py_T_USHORT as T_USHORT; -#[allow(deprecated)] -pub use crate::_Py_T_OBJECT as T_OBJECT; -pub use crate::Py_T_PYSSIZET as T_PYSSIZET; #[allow(deprecated)] pub use crate::_Py_T_NONE as T_NONE; +pub use crate::Py_T_PYSSIZET as T_PYSSIZET; /* Flags */ pub use crate::Py_READONLY as READONLY; diff --git a/src/pyclass/create_type_object.rs b/src/pyclass/create_type_object.rs index 9c72a9b4d1a..063b615c8a4 100644 --- a/src/pyclass/create_type_object.rs +++ b/src/pyclass/create_type_object.rs @@ -11,7 +11,7 @@ use crate::{ assign_sequence_item_from_mapping, get_sequence_item_from_mapping, tp_dealloc, tp_dealloc_with_gc, PyClassImpl, PyClassItemsIter, PyObjectOffset, }, - pymethods::{Getter, PyGetterDef, PyMethodDefType, PySetterDef, Setter, _call_clear}, + pymethods::{_call_clear, Getter, PyGetterDef, PyMethodDefType, PySetterDef, Setter}, trampoline::trampoline, }, pycell::impl_::PyClassObjectLayout, diff --git a/tests/ui/abi3_inheritance.stderr b/tests/ui/abi3_inheritance.stderr index a98a2b6148e..5211488e738 100644 --- a/tests/ui/abi3_inheritance.stderr +++ b/tests/ui/abi3_inheritance.stderr @@ -4,10 +4,10 @@ error[E0277]: pyclass `PyException` cannot be subclassed 4 | #[pyclass(extends=PyException)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required for `#[pyclass(extends=PyException)]` | - = help: the trait `PyClassBaseType` is not implemented for `PyException` + = help: the trait `pyo3::impl_::pyclass::PyClassBaseType` is not implemented for `PyException` = note: `PyException` must have `#[pyclass(subclass)]` to be eligible for subclassing = note: subclassing native types requires Python >= 3.12 when using the `abi3` feature -help: the trait `PyClassBaseType` is implemented for `PyAny` +help: the trait `pyo3::impl_::pyclass::PyClassBaseType` is implemented for `PyAny` --> src/types/any.rs | | impl crate::impl_::pyclass::PyClassBaseType for PyAny { @@ -20,15 +20,15 @@ error[E0277]: pyclass `PyException` cannot be subclassed 4 | #[pyclass(extends=PyException)] | ^^^^^^^^^^^ required for `#[pyclass(extends=PyException)]` | - = help: the trait `PyClassBaseType` is not implemented for `PyException` + = help: the trait `pyo3::impl_::pyclass::PyClassBaseType` is not implemented for `PyException` = note: `PyException` must have `#[pyclass(subclass)]` to be eligible for subclassing = note: subclassing native types requires Python >= 3.12 when using the `abi3` feature -help: the trait `PyClassBaseType` is implemented for `PyAny` +help: the trait `pyo3::impl_::pyclass::PyClassBaseType` is implemented for `PyAny` --> src/types/any.rs | | impl crate::impl_::pyclass::PyClassBaseType for PyAny { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required by a bound in `PyClassImpl::BaseType` +note: required by a bound in `pyo3::impl_::pyclass::PyClassImpl::BaseType` --> src/impl_/pyclass.rs | | type BaseType: PyTypeInfo + PyClassBaseType; diff --git a/tests/ui/abi3_nativetype_inheritance.stderr b/tests/ui/abi3_nativetype_inheritance.stderr index c42e6aa0662..e8801deb104 100644 --- a/tests/ui/abi3_nativetype_inheritance.stderr +++ b/tests/ui/abi3_nativetype_inheritance.stderr @@ -4,10 +4,10 @@ error[E0277]: pyclass `PyDict` cannot be subclassed 5 | #[pyclass(extends=PyDict)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required for `#[pyclass(extends=PyDict)]` | - = help: the trait `PyClassBaseType` is not implemented for `PyDict` + = help: the trait `pyo3::impl_::pyclass::PyClassBaseType` is not implemented for `PyDict` = note: `PyDict` must have `#[pyclass(subclass)]` to be eligible for subclassing = note: subclassing native types requires Python >= 3.12 when using the `abi3` feature -help: the trait `PyClassBaseType` is implemented for `PyAny` +help: the trait `pyo3::impl_::pyclass::PyClassBaseType` is implemented for `PyAny` --> src/types/any.rs | | impl crate::impl_::pyclass::PyClassBaseType for PyAny { @@ -20,15 +20,15 @@ error[E0277]: pyclass `PyDict` cannot be subclassed 5 | #[pyclass(extends=PyDict)] | ^^^^^^ required for `#[pyclass(extends=PyDict)]` | - = help: the trait `PyClassBaseType` is not implemented for `PyDict` + = help: the trait `pyo3::impl_::pyclass::PyClassBaseType` is not implemented for `PyDict` = note: `PyDict` must have `#[pyclass(subclass)]` to be eligible for subclassing = note: subclassing native types requires Python >= 3.12 when using the `abi3` feature -help: the trait `PyClassBaseType` is implemented for `PyAny` +help: the trait `pyo3::impl_::pyclass::PyClassBaseType` is implemented for `PyAny` --> src/types/any.rs | | impl crate::impl_::pyclass::PyClassBaseType for PyAny { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: required by a bound in `PyClassImpl::BaseType` +note: required by a bound in `pyo3::impl_::pyclass::PyClassImpl::BaseType` --> src/impl_/pyclass.rs | | type BaseType: PyTypeInfo + PyClassBaseType; diff --git a/tests/ui/duplicate_pymodule_submodule.stderr b/tests/ui/duplicate_pymodule_submodule.stderr index a2141b0dcd3..284ef029c93 100644 --- a/tests/ui/duplicate_pymodule_submodule.stderr +++ b/tests/ui/duplicate_pymodule_submodule.stderr @@ -3,15 +3,3 @@ error: `submodule` may only be specified once (it is implicitly always specified | 4 | mod submod {} | ^^^ - -error[E0425]: cannot find value `_PYO3_DEF` in module `submod` - --> tests/ui/duplicate_pymodule_submodule.rs:1:1 - | -1 | #[pyo3::pymodule] - | ^^^^^^^^^^^^^^^^^ not found in `submod` - | - = note: this error originates in the attribute macro `pyo3::pymodule` (in Nightly builds, run with -Z macro-backtrace for more info) -help: consider importing this static - | -3 + use crate::mymodule::_PYO3_DEF; - | diff --git a/tests/ui/invalid_argument_attributes.stderr b/tests/ui/invalid_argument_attributes.stderr index d59558c16b9..8dc4a85d3d5 100644 --- a/tests/ui/invalid_argument_attributes.stderr +++ b/tests/ui/invalid_argument_attributes.stderr @@ -27,9 +27,3 @@ error: expected identifier | 23 | fn f(#[pyo3(from_py_with = "bytes_from_py")] _bytes: Vec) {} | ^^^^^^^^^^^^^^^ - -error[E0425]: cannot find value `func` in this scope - --> tests/ui/invalid_argument_attributes.rs:13:55 - | -13 | fn from_py_with_value_not_found(#[pyo3(from_py_with = func)] _param: String) {} - | ^^^^ not found in this scope diff --git a/tests/ui/invalid_base_class.stderr b/tests/ui/invalid_base_class.stderr index a9262564cec..453c87c5f8a 100644 --- a/tests/ui/invalid_base_class.stderr +++ b/tests/ui/invalid_base_class.stderr @@ -4,9 +4,9 @@ error[E0277]: pyclass `PyBool` cannot be subclassed 4 | #[pyclass(extends=PyBool)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ required for `#[pyclass(extends=PyBool)]` | - = help: the trait `PyClassBaseType` is not implemented for `PyBool` + = help: the trait `pyo3::impl_::pyclass::PyClassBaseType` is not implemented for `PyBool` = note: `PyBool` must have `#[pyclass(subclass)]` to be eligible for subclassing - = help: the following other types implement trait `PyClassBaseType`: + = help: the following other types implement trait `pyo3::impl_::pyclass::PyClassBaseType`: PyAny PyArithmeticError PyAssertionError @@ -24,9 +24,9 @@ error[E0277]: pyclass `PyBool` cannot be subclassed 4 | #[pyclass(extends=PyBool)] | ^^^^^^ required for `#[pyclass(extends=PyBool)]` | - = help: the trait `PyClassBaseType` is not implemented for `PyBool` + = help: the trait `pyo3::impl_::pyclass::PyClassBaseType` is not implemented for `PyBool` = note: `PyBool` must have `#[pyclass(subclass)]` to be eligible for subclassing - = help: the following other types implement trait `PyClassBaseType`: + = help: the following other types implement trait `pyo3::impl_::pyclass::PyClassBaseType`: PyAny PyArithmeticError PyAssertionError @@ -36,7 +36,7 @@ error[E0277]: pyclass `PyBool` cannot be subclassed PyBlockingIOError PyBrokenPipeError and $N others -note: required by a bound in `PyClassImpl::BaseType` +note: required by a bound in `pyo3::impl_::pyclass::PyClassImpl::BaseType` --> src/impl_/pyclass.rs | | type BaseType: PyTypeInfo + PyClassBaseType; diff --git a/tests/ui/invalid_frompy_derive.stderr b/tests/ui/invalid_frompy_derive.stderr index 484c4ce44f4..00222304b0c 100644 --- a/tests/ui/invalid_frompy_derive.stderr +++ b/tests/ui/invalid_frompy_derive.stderr @@ -273,9 +273,3 @@ error: Useless variant `rename_all` - enum is already annotated with `rename_all | 258 | #[pyo3(rename_all = "camelCase")] | ^^^^^^^^^^ - -error[E0425]: cannot find value `func` in this scope - --> tests/ui/invalid_frompy_derive.rs:164:27 - | -164 | #[pyo3(from_py_with = func)] - | ^^^^ not found in this scope diff --git a/tests/ui/invalid_frozen_pyclass_borrow.stderr b/tests/ui/invalid_frozen_pyclass_borrow.stderr index 5bfa9ee0808..d049ab98f8d 100644 --- a/tests/ui/invalid_frozen_pyclass_borrow.stderr +++ b/tests/ui/invalid_frozen_pyclass_borrow.stderr @@ -10,12 +10,12 @@ error[E0271]: type mismatch resolving `::Frozen == False` 11 | fn mut_method(&mut self) {} | ^ type mismatch resolving `::Frozen == False` | -note: expected this to be `False` +note: expected this to be `pyo3::pyclass::boolean_struct::False` --> tests/ui/invalid_frozen_pyclass_borrow.rs:3:1 | 3 | #[pyclass(frozen)] | ^^^^^^^^^^^^^^^^^^ -note: required by a bound in `extract_pyclass_ref_mut` +note: required by a bound in `pyo3::impl_::extract_argument::extract_pyclass_ref_mut` --> src/impl_/extract_argument.rs | | pub fn extract_pyclass_ref_mut<'a, 'holder, T: PyClass>( @@ -28,7 +28,7 @@ error[E0271]: type mismatch resolving `::Frozen == False` 9 | #[pymethods] | ^^^^^^^^^^^^ type mismatch resolving `::Frozen == False` | -note: expected this to be `False` +note: expected this to be `pyo3::pyclass::boolean_struct::False` --> tests/ui/invalid_frozen_pyclass_borrow.rs:3:1 | 3 | #[pyclass(frozen)] @@ -46,7 +46,7 @@ error[E0271]: type mismatch resolving `::Frozen == False` 15 | let borrow = foo.bind(py).borrow_mut(); | ^^^^^^^^^^ type mismatch resolving `::Frozen == False` | -note: expected this to be `False` +note: expected this to be `pyo3::pyclass::boolean_struct::False` --> tests/ui/invalid_frozen_pyclass_borrow.rs:3:1 | 3 | #[pyclass(frozen)] @@ -67,7 +67,7 @@ error[E0271]: type mismatch resolving `::Frozen == Fa 25 | let borrow = child.bind(py).borrow_mut(); | ^^^^^^^^^^ type mismatch resolving `::Frozen == False` | -note: expected this to be `False` +note: expected this to be `pyo3::pyclass::boolean_struct::False` --> tests/ui/invalid_frozen_pyclass_borrow.rs:21:1 | 21 | #[pyclass(frozen, extends = MutableBase)] @@ -88,7 +88,7 @@ error[E0271]: type mismatch resolving `::Frozen == True` 29 | class.get(); | ^^^ type mismatch resolving `::Frozen == True` | -note: expected this to be `True` +note: expected this to be `pyo3::pyclass::boolean_struct::True` --> tests/ui/invalid_frozen_pyclass_borrow.rs:18:1 | 18 | #[pyclass(subclass)] @@ -109,7 +109,7 @@ error[E0271]: type mismatch resolving `::Frozen == True` 33 | class.get(); | ^^^ type mismatch resolving `::Frozen == True` | -note: expected this to be `True` +note: expected this to be `pyo3::pyclass::boolean_struct::True` --> tests/ui/invalid_frozen_pyclass_borrow.rs:18:1 | 18 | #[pyclass(subclass)] diff --git a/tests/ui/invalid_property_args.stderr b/tests/ui/invalid_property_args.stderr index 223003f11bb..6e1d7282ede 100644 --- a/tests/ui/invalid_property_args.stderr +++ b/tests/ui/invalid_property_args.stderr @@ -64,8 +64,8 @@ error[E0277]: `PhantomData` cannot be converted to a Python object &'a (T0, T1, T2, T3) &'a (T0, T1, T2, T3, T4) and $N others - = note: required for `PhantomData` to implement `for<'py> PyO3GetField<'py>` -note: required by a bound in `PyClassGetterGenerator::::generate` + = note: required for `PhantomData` to implement `for<'py> pyo3::impl_::pyclass::PyO3GetField<'py>` +note: required by a bound in `pyo3::impl_::pyclass::PyClassGetterGenerator::::generate` --> src/impl_/pyclass.rs | | pub const fn generate(&self, name: &'static CStr, doc: Option<&'static CStr>) -> PyMethodDefType diff --git a/tests/ui/invalid_pyclass_args.stderr b/tests/ui/invalid_pyclass_args.stderr index 9dab7481a38..90a909b6a8e 100644 --- a/tests/ui/invalid_pyclass_args.stderr +++ b/tests/ui/invalid_pyclass_args.stderr @@ -181,7 +181,7 @@ help: consider annotating `StructFromPyObjectNoClone` with `#[derive(Clone)]` 192 | struct StructFromPyObjectNoClone { | -error[E0119]: conflicting implementations of trait `PyClassNewTextSignature` for type `NewFromFieldsWithManualNew` +error[E0119]: conflicting implementations of trait `pyo3::impl_::pyclass::doc::PyClassNewTextSignature` for type `NewFromFieldsWithManualNew` --> tests/ui/invalid_pyclass_args.rs:213:1 | 208 | #[pyclass(new = "from_fields")] @@ -442,8 +442,8 @@ error[E0277]: `Box` cannot be used as a Pyt NewFromFieldsWithManualNew and $N others = note: required for `Box` to implement `pyo3::FromPyObject<'_, '_>` - = note: required for `Box` to implement `PyFunctionArgument<'_, '_, '_, true>` -note: required by a bound in `extract_argument` + = note: required for `Box` to implement `pyo3::impl_::extract_argument::PyFunctionArgument<'_, '_, '_, true>` +note: required by a bound in `pyo3::impl_::extract_argument::extract_argument` --> src/impl_/extract_argument.rs | | pub fn extract_argument<'a, 'holder, 'py, T, const IMPLEMENTS_FROMPYOBJECT: bool>( @@ -456,11 +456,11 @@ error[E0277]: `Box` cannot be used as a Pyt --> tests/ui/invalid_pyclass_args.rs:205:12 | 205 | field: Box, - | ^^^ the trait `ExtractPyClassWithClone` is not implemented for `Box` + | ^^^ the trait `pyo3::impl_::pyclass::ExtractPyClassWithClone` is not implemented for `Box` | = note: implement `FromPyObject` to enable using `Box` as a function argument = note: `Python<'py>` is also a valid argument type to pass the Python token into `#[pyfunction]`s and `#[pymethods]` - = help: the following other types implement trait `ExtractPyClassWithClone`: + = help: the following other types implement trait `pyo3::impl_::pyclass::ExtractPyClassWithClone`: Coord Coord2 Coord3 @@ -471,8 +471,8 @@ error[E0277]: `Box` cannot be used as a Pyt NewFromFieldsWithManualNew and $N others = note: required for `Box` to implement `pyo3::FromPyObject<'_, '_>` - = note: required for `Box` to implement `PyFunctionArgument<'_, '_, '_, true>` -note: required by a bound in `extract_argument` + = note: required for `Box` to implement `pyo3::impl_::extract_argument::PyFunctionArgument<'_, '_, '_, true>` +note: required by a bound in `pyo3::impl_::extract_argument::extract_argument` --> src/impl_/extract_argument.rs | | pub fn extract_argument<'a, 'holder, 'py, T, const IMPLEMENTS_FROMPYOBJECT: bool>( @@ -487,30 +487,30 @@ error[E0277]: the trait bound `dyn std::error::Error + Send + Sync: Clone` is no 205 | field: Box, | ^^^ the trait `Clone` is not implemented for `dyn std::error::Error + Send + Sync` | -help: the following other types implement trait `PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>` +help: the following other types implement trait `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>` --> src/impl_/extract_argument.rs | | / impl<'a, 'holder, 'py, T: 'a + 'py> PyFunctionArgument<'a, 'holder, 'py, false> | | for &'holder Bound<'py, T> | | where | | T: PyTypeCheck, - | |___________________^ `&'holder pyo3::Bound<'py, T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>` + | |___________________^ `&'holder pyo3::Bound<'py, T>` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, 'py, false>` ... | / impl<'a, 'holder, 'py, T> PyFunctionArgument<'a, 'holder, 'py, false> for Option | | where | | T: PyFunctionArgument<'a, 'holder, 'py, false>, - | |___________________________________________________^ `Option` implements `PyFunctionArgument<'a, 'holder, 'py, false>` + | |___________________________________________________^ `Option` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, 'py, false>` ... | impl<'a, 'holder, T: PyClass> PyFunctionArgument<'a, 'holder, '_, false> for &'holder T { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'holder T` implements `PyFunctionArgument<'a, 'holder, '_, false>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'holder T` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, '_, false>` ... | / impl<'a, 'holder, T: PyClass> PyFunctionArgument<'a, 'holder, '_, false> | | for &'holder mut T - | |______________________^ `&'holder mut T` implements `PyFunctionArgument<'a, 'holder, '_, false>` + | |______________________^ `&'holder mut T` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, '_, false>` = note: required for `Box` to implement `Clone` = note: required for `Box` to implement `pyo3::FromPyObject<'_, '_>` - = note: required for `Box` to implement `PyFunctionArgument<'_, '_, '_, true>` -note: required by a bound in `extract_argument` + = note: required for `Box` to implement `pyo3::impl_::extract_argument::PyFunctionArgument<'_, '_, '_, true>` +note: required by a bound in `pyo3::impl_::extract_argument::extract_argument` --> src/impl_/extract_argument.rs | | pub fn extract_argument<'a, 'holder, 'py, T, const IMPLEMENTS_FROMPYOBJECT: bool>( diff --git a/tests/ui/invalid_pyclass_generic.stderr b/tests/ui/invalid_pyclass_generic.stderr index 03981816475..179399d17c3 100644 --- a/tests/ui/invalid_pyclass_generic.stderr +++ b/tests/ui/invalid_pyclass_generic.stderr @@ -68,8 +68,8 @@ error[E0034]: multiple applicable items in scope 4 | #[pyclass(generic)] | ^^^^^^^^^^^^^^^^^^^ multiple `wrap` found | - = note: candidate #1 is defined in an impl for the type `IntoPyObjectConverter>` - = note: candidate #2 is defined in an impl for the type `IntoPyObjectConverter` + = note: candidate #1 is defined in an impl for the type `pyo3::impl_::wrap::IntoPyObjectConverter>` + = note: candidate #2 is defined in an impl for the type `pyo3::impl_::wrap::IntoPyObjectConverter` = note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types @@ -128,5 +128,5 @@ error[E0034]: multiple applicable items in scope 18 | ) -> PyResult> { | ^^^^^^^^ multiple `wrap` found | - = note: candidate #1 is defined in an impl for the type `IntoPyObjectConverter>` - = note: candidate #2 is defined in an impl for the type `IntoPyObjectConverter` + = note: candidate #1 is defined in an impl for the type `pyo3::impl_::wrap::IntoPyObjectConverter>` + = note: candidate #2 is defined in an impl for the type `pyo3::impl_::wrap::IntoPyObjectConverter` diff --git a/tests/ui/invalid_pyclass_init.stderr b/tests/ui/invalid_pyclass_init.stderr index 245d58de593..8380964a1be 100644 --- a/tests/ui/invalid_pyclass_init.stderr +++ b/tests/ui/invalid_pyclass_init.stderr @@ -1,14 +1,14 @@ -error[E0277]: the trait bound `i32: IntoPyCallbackOutput<'_, i32>` is not satisfied +error[E0277]: the trait bound `i32: pyo3::impl_::callback::IntoPyCallbackOutput<'_, i32>` is not satisfied --> tests/ui/invalid_pyclass_init.rs:8:27 | 8 | fn __init__(&self) -> i32 { - | ^^^ the trait `IntoPyCallbackOutput<'_, i32>` is not implemented for `i32` + | ^^^ the trait `pyo3::impl_::callback::IntoPyCallbackOutput<'_, i32>` is not implemented for `i32` | -help: the following other types implement trait `IntoPyCallbackOutput<'py, Target>` +help: the following other types implement trait `pyo3::impl_::callback::IntoPyCallbackOutput<'py, Target>` --> src/impl_/callback.rs | | impl IntoPyCallbackOutput<'_, ffi::Py_ssize_t> for usize { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `usize` implements `IntoPyCallbackOutput<'_, isize>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `usize` implements `pyo3::impl_::callback::IntoPyCallbackOutput<'_, isize>` ... | impl IntoPyCallbackOutput<'_, usize> for usize { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `usize` implements `IntoPyCallbackOutput<'_, usize>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `usize` implements `pyo3::impl_::callback::IntoPyCallbackOutput<'_, usize>` diff --git a/tests/ui/invalid_pyfunction_argument.stderr b/tests/ui/invalid_pyfunction_argument.stderr index 073137e293f..f0f935dd878 100644 --- a/tests/ui/invalid_pyfunction_argument.stderr +++ b/tests/ui/invalid_pyfunction_argument.stderr @@ -12,8 +12,8 @@ help: the trait `PyClass` is implemented for `Foo` 9 | #[pyclass(skip_from_py_object)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: required for `AtomicPtr<()>` to implement `FromPyObject<'_, '_>` - = note: required for `AtomicPtr<()>` to implement `PyFunctionArgument<'_, '_, '_, true>` -note: required by a bound in `extract_argument` + = note: required for `AtomicPtr<()>` to implement `pyo3::impl_::extract_argument::PyFunctionArgument<'_, '_, '_, true>` +note: required by a bound in `pyo3::impl_::extract_argument::extract_argument` --> src/impl_/extract_argument.rs | | pub fn extract_argument<'a, 'holder, 'py, T, const IMPLEMENTS_FROMPYOBJECT: bool>( @@ -31,29 +31,29 @@ error[E0277]: `AtomicPtr<()>` cannot be used as a Python function argument | = note: implement `FromPyObject` to enable using `AtomicPtr<()>` as a function argument = note: `Python<'py>` is also a valid argument type to pass the Python token into `#[pyfunction]`s and `#[pymethods]` -help: the following other types implement trait `PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>` +help: the following other types implement trait `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>` --> src/impl_/extract_argument.rs | | / impl<'a, 'holder, 'py, T: 'a + 'py> PyFunctionArgument<'a, 'holder, 'py, false> | | for &'holder Bound<'py, T> | | where | | T: PyTypeCheck, - | |___________________^ `&'holder pyo3::Bound<'py, T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>` + | |___________________^ `&'holder pyo3::Bound<'py, T>` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, 'py, false>` ... | / impl<'a, 'holder, 'py, T> PyFunctionArgument<'a, 'holder, 'py, false> for Option | | where | | T: PyFunctionArgument<'a, 'holder, 'py, false>, - | |___________________________________________________^ `Option` implements `PyFunctionArgument<'a, 'holder, 'py, false>` + | |___________________________________________________^ `Option` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, 'py, false>` ... | impl<'a, 'holder, T: PyClass> PyFunctionArgument<'a, 'holder, '_, false> for &'holder T { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'holder T` implements `PyFunctionArgument<'a, 'holder, '_, false>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'holder T` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, '_, false>` ... | / impl<'a, 'holder, T: PyClass> PyFunctionArgument<'a, 'holder, '_, false> | | for &'holder mut T - | |______________________^ `&'holder mut T` implements `PyFunctionArgument<'a, 'holder, '_, false>` + | |______________________^ `&'holder mut T` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, '_, false>` = note: required for `AtomicPtr<()>` to implement `FromPyObject<'_, '_>` - = note: required for `AtomicPtr<()>` to implement `PyFunctionArgument<'_, '_, '_, true>` -note: required by a bound in `extract_argument` + = note: required for `AtomicPtr<()>` to implement `pyo3::impl_::extract_argument::PyFunctionArgument<'_, '_, '_, true>` +note: required by a bound in `pyo3::impl_::extract_argument::extract_argument` --> src/impl_/extract_argument.rs | | pub fn extract_argument<'a, 'holder, 'py, T, const IMPLEMENTS_FROMPYOBJECT: bool>( @@ -66,33 +66,33 @@ error[E0277]: `AtomicPtr<()>` cannot be used as a Python function argument --> tests/ui/invalid_pyfunction_argument.rs:5:37 | 5 | fn invalid_pyfunction_argument(arg: AtomicPtr<()>) { - | ^^^^^^^^^ the trait `ExtractPyClassWithClone` is not implemented for `AtomicPtr<()>` + | ^^^^^^^^^ the trait `pyo3::impl_::pyclass::ExtractPyClassWithClone` is not implemented for `AtomicPtr<()>` | = note: implement `FromPyObject` to enable using `AtomicPtr<()>` as a function argument = note: `Python<'py>` is also a valid argument type to pass the Python token into `#[pyfunction]`s and `#[pymethods]` -help: the following other types implement trait `PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>` +help: the following other types implement trait `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>` --> src/impl_/extract_argument.rs | | / impl<'a, 'holder, 'py, T: 'a + 'py> PyFunctionArgument<'a, 'holder, 'py, false> | | for &'holder Bound<'py, T> | | where | | T: PyTypeCheck, - | |___________________^ `&'holder pyo3::Bound<'py, T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>` + | |___________________^ `&'holder pyo3::Bound<'py, T>` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, 'py, false>` ... | / impl<'a, 'holder, 'py, T> PyFunctionArgument<'a, 'holder, 'py, false> for Option | | where | | T: PyFunctionArgument<'a, 'holder, 'py, false>, - | |___________________________________________________^ `Option` implements `PyFunctionArgument<'a, 'holder, 'py, false>` + | |___________________________________________________^ `Option` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, 'py, false>` ... | impl<'a, 'holder, T: PyClass> PyFunctionArgument<'a, 'holder, '_, false> for &'holder T { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'holder T` implements `PyFunctionArgument<'a, 'holder, '_, false>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'holder T` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, '_, false>` ... | / impl<'a, 'holder, T: PyClass> PyFunctionArgument<'a, 'holder, '_, false> | | for &'holder mut T - | |______________________^ `&'holder mut T` implements `PyFunctionArgument<'a, 'holder, '_, false>` + | |______________________^ `&'holder mut T` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, '_, false>` = note: required for `AtomicPtr<()>` to implement `FromPyObject<'_, '_>` - = note: required for `AtomicPtr<()>` to implement `PyFunctionArgument<'_, '_, '_, true>` -note: required by a bound in `extract_argument` + = note: required for `AtomicPtr<()>` to implement `pyo3::impl_::extract_argument::PyFunctionArgument<'_, '_, '_, true>` +note: required by a bound in `pyo3::impl_::extract_argument::extract_argument` --> src/impl_/extract_argument.rs | | pub fn extract_argument<'a, 'holder, 'py, T, const IMPLEMENTS_FROMPYOBJECT: bool>( @@ -107,36 +107,36 @@ error[E0277]: `Foo` cannot be used as a Python function argument 14 | fn skip_from_py_object_without_custom_from_py_object(arg: Foo) { | ^^^ unsatisfied trait bound | -help: the trait `ExtractPyClassWithClone` is not implemented for `Foo` +help: the trait `pyo3::impl_::pyclass::ExtractPyClassWithClone` is not implemented for `Foo` --> tests/ui/invalid_pyfunction_argument.rs:11:1 | 11 | struct Foo; | ^^^^^^^^^^ = note: implement `FromPyObject` to enable using `Foo` as a function argument = note: `Python<'py>` is also a valid argument type to pass the Python token into `#[pyfunction]`s and `#[pymethods]` -help: the following other types implement trait `PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>` +help: the following other types implement trait `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, 'py, IMPLEMENTS_FROMPYOBJECT>` --> src/impl_/extract_argument.rs | | / impl<'a, 'holder, 'py, T: 'a + 'py> PyFunctionArgument<'a, 'holder, 'py, false> | | for &'holder Bound<'py, T> | | where | | T: PyTypeCheck, - | |___________________^ `&'holder pyo3::Bound<'py, T>` implements `PyFunctionArgument<'a, 'holder, 'py, false>` + | |___________________^ `&'holder pyo3::Bound<'py, T>` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, 'py, false>` ... | / impl<'a, 'holder, 'py, T> PyFunctionArgument<'a, 'holder, 'py, false> for Option | | where | | T: PyFunctionArgument<'a, 'holder, 'py, false>, - | |___________________________________________________^ `Option` implements `PyFunctionArgument<'a, 'holder, 'py, false>` + | |___________________________________________________^ `Option` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, 'py, false>` ... | impl<'a, 'holder, T: PyClass> PyFunctionArgument<'a, 'holder, '_, false> for &'holder T { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'holder T` implements `PyFunctionArgument<'a, 'holder, '_, false>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'holder T` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, '_, false>` ... | / impl<'a, 'holder, T: PyClass> PyFunctionArgument<'a, 'holder, '_, false> | | for &'holder mut T - | |______________________^ `&'holder mut T` implements `PyFunctionArgument<'a, 'holder, '_, false>` + | |______________________^ `&'holder mut T` implements `pyo3::impl_::extract_argument::PyFunctionArgument<'a, 'holder, '_, false>` = note: required for `Foo` to implement `FromPyObject<'_, '_>` - = note: required for `Foo` to implement `PyFunctionArgument<'_, '_, '_, true>` -note: required by a bound in `extract_argument` + = note: required for `Foo` to implement `pyo3::impl_::extract_argument::PyFunctionArgument<'_, '_, '_, true>` +note: required by a bound in `pyo3::impl_::extract_argument::extract_argument` --> src/impl_/extract_argument.rs | | pub fn extract_argument<'a, 'holder, 'py, T, const IMPLEMENTS_FROMPYOBJECT: bool>( diff --git a/tests/ui/invalid_pymethod_enum.stderr b/tests/ui/invalid_pymethod_enum.stderr index 3c574320cb5..896a637460a 100644 --- a/tests/ui/invalid_pymethod_enum.stderr +++ b/tests/ui/invalid_pymethod_enum.stderr @@ -4,12 +4,12 @@ error[E0271]: type mismatch resolving `::Frozen == False 11 | fn mutate_in_place(&mut self) { | ^ type mismatch resolving `::Frozen == False` | -note: expected this to be `False` +note: expected this to be `pyo3::pyclass::boolean_struct::False` --> tests/ui/invalid_pymethod_enum.rs:3:1 | 3 | #[pyclass] | ^^^^^^^^^^ -note: required by a bound in `extract_pyclass_ref_mut` +note: required by a bound in `pyo3::impl_::extract_argument::extract_pyclass_ref_mut` --> src/impl_/extract_argument.rs | | pub fn extract_pyclass_ref_mut<'a, 'holder, T: PyClass>( @@ -22,7 +22,7 @@ error[E0271]: type mismatch resolving `::Frozen == False 9 | #[pymethods] | ^^^^^^^^^^^^ type mismatch resolving `::Frozen == False` | -note: expected this to be `False` +note: expected this to be `pyo3::pyclass::boolean_struct::False` --> tests/ui/invalid_pymethod_enum.rs:3:1 | 3 | #[pyclass] @@ -40,12 +40,12 @@ error[E0271]: type mismatch resolving `::Frozen == False` 27 | fn mutate_in_place(&mut self) { | ^ type mismatch resolving `::Frozen == False` | -note: expected this to be `False` +note: expected this to be `pyo3::pyclass::boolean_struct::False` --> tests/ui/invalid_pymethod_enum.rs:19:1 | 19 | #[pyclass] | ^^^^^^^^^^ -note: required by a bound in `extract_pyclass_ref_mut` +note: required by a bound in `pyo3::impl_::extract_argument::extract_pyclass_ref_mut` --> src/impl_/extract_argument.rs | | pub fn extract_pyclass_ref_mut<'a, 'holder, T: PyClass>( @@ -58,7 +58,7 @@ error[E0271]: type mismatch resolving `::Frozen == False` 25 | #[pymethods] | ^^^^^^^^^^^^ type mismatch resolving `::Frozen == False` | -note: expected this to be `False` +note: expected this to be `pyo3::pyclass::boolean_struct::False` --> tests/ui/invalid_pymethod_enum.rs:19:1 | 19 | #[pyclass] diff --git a/tests/ui/invalid_pymethods_duplicates.stderr b/tests/ui/invalid_pymethods_duplicates.stderr index 215bc0640cd..fdc6f780d91 100644 --- a/tests/ui/invalid_pymethods_duplicates.stderr +++ b/tests/ui/invalid_pymethods_duplicates.stderr @@ -1,4 +1,4 @@ -error[E0119]: conflicting implementations of trait `PyClassNewTextSignature` for type `TwoNew` +error[E0119]: conflicting implementations of trait `pyo3::impl_::pyclass::doc::PyClassNewTextSignature` for type `TwoNew` --> tests/ui/invalid_pymethods_duplicates.rs:9:1 | 9 | #[pymethods] diff --git a/tests/ui/missing_intopy.stderr b/tests/ui/missing_intopy.stderr index 2d3e39dadea..327c8bdf6f7 100644 --- a/tests/ui/missing_intopy.stderr +++ b/tests/ui/missing_intopy.stderr @@ -22,7 +22,7 @@ help: the trait `IntoPyObject<'_>` is not implemented for `Blah` &'a (T0, T1, T2, T3) &'a (T0, T1, T2, T3, T4) and $N others -note: required by a bound in `UnknownReturnType::::wrap` +note: required by a bound in `pyo3::impl_::wrap::UnknownReturnType::::wrap` --> src/impl_/wrap.rs | | pub fn wrap<'py>(&self, _: T) -> T diff --git a/tests/ui/pyclass_send.stderr b/tests/ui/pyclass_send.stderr index e4f1680edd2..ff482f8e402 100644 --- a/tests/ui/pyclass_send.stderr +++ b/tests/ui/pyclass_send.stderr @@ -10,7 +10,7 @@ note: required because it appears within the type `NotSyncNotSend` | 5 | struct NotSyncNotSend(*mut c_void); | ^^^^^^^^^^^^^^ -note: required by a bound in `assert_pyclass_send_sync` +note: required by a bound in `pyo3::impl_::pyclass::assertions::assert_pyclass_send_sync` --> src/impl_/pyclass/assertions.rs | | pub const fn assert_pyclass_send_sync() @@ -31,7 +31,7 @@ note: required because it appears within the type `NotSyncNotSend` | 5 | struct NotSyncNotSend(*mut c_void); | ^^^^^^^^^^^^^^ -note: required by a bound in `assert_pyclass_send_sync` +note: required by a bound in `pyo3::impl_::pyclass::assertions::assert_pyclass_send_sync` --> src/impl_/pyclass/assertions.rs | | pub const fn assert_pyclass_send_sync() @@ -52,7 +52,7 @@ note: required because it appears within the type `SendNotSync` | 8 | struct SendNotSync(*mut c_void); | ^^^^^^^^^^^ -note: required by a bound in `assert_pyclass_send_sync` +note: required by a bound in `pyo3::impl_::pyclass::assertions::assert_pyclass_send_sync` --> src/impl_/pyclass/assertions.rs | | pub const fn assert_pyclass_send_sync() @@ -73,7 +73,7 @@ note: required because it appears within the type `SyncNotSend` | 12 | struct SyncNotSend(*mut c_void); | ^^^^^^^^^^^ -note: required by a bound in `assert_pyclass_send_sync` +note: required by a bound in `pyo3::impl_::pyclass::assertions::assert_pyclass_send_sync` --> src/impl_/pyclass/assertions.rs | | pub const fn assert_pyclass_send_sync()