pyo3/tests/ui/invalid_frozen_pyclass_borrow.stderr
David Hewitt 870a4bb20d
deprecate GIL refs in function argument (#3847)
* deprecate GIL Refs in function arguments

* fix deprecated gil refs in function arguments

* add notes on deprecations limitations to migration guide

* Apply suggestions from code review

Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>

* review: Icxolu

* fix proto method extract failure for option

* fix gil refs in examples

---------

Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>
2024-03-20 22:35:08 +00:00

91 lines
3.5 KiB
Plaintext

error: cannot use `#[pyo3(set)]` on a `frozen` class
--> tests/ui/invalid_frozen_pyclass_borrow.rs:38:12
|
38 | #[pyo3(set)]
| ^^^
error[E0271]: type mismatch resolving `<Foo as PyClass>::Frozen == False`
--> tests/ui/invalid_frozen_pyclass_borrow.rs:11:19
|
11 | fn mut_method(&mut self) {}
| ^ expected `False`, found `True`
|
note: required by a bound in `extract_pyclass_ref_mut`
--> src/impl_/extract_argument.rs
|
| pub fn extract_pyclass_ref_mut<'a, 'py: 'a, T: PyClass<Frozen = False>>(
| ^^^^^^^^^^^^^^ required by this bound in `extract_pyclass_ref_mut`
error[E0271]: type mismatch resolving `<Foo as PyClass>::Frozen == False`
--> tests/ui/invalid_frozen_pyclass_borrow.rs:9:1
|
9 | #[pymethods]
| ^^^^^^^^^^^^ expected `False`, found `True`
|
note: required by a bound in `PyRefMut`
--> src/pycell.rs
|
| pub struct PyRefMut<'p, T: PyClass<Frozen = False>> {
| ^^^^^^^^^^^^^^ required by this bound in `PyRefMut`
= note: this error originates in the attribute macro `pymethods` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0271]: type mismatch resolving `<Foo as PyClass>::Frozen == False`
--> tests/ui/invalid_frozen_pyclass_borrow.rs:15:31
|
15 | let borrow = foo.bind(py).borrow_mut();
| ^^^^^^^^^^ expected `False`, found `True`
|
note: required by a bound in `pyo3::Bound::<'py, T>::borrow_mut`
--> src/instance.rs
|
| pub fn borrow_mut(&self) -> PyRefMut<'py, T>
| ---------- required by a bound in this associated function
| where
| T: PyClass<Frozen = False>,
| ^^^^^^^^^^^^^^ required by this bound in `Bound::<'py, T>::borrow_mut`
error[E0271]: type mismatch resolving `<ImmutableChild as PyClass>::Frozen == False`
--> tests/ui/invalid_frozen_pyclass_borrow.rs:25:33
|
25 | let borrow = child.bind(py).borrow_mut();
| ^^^^^^^^^^ expected `False`, found `True`
|
note: required by a bound in `pyo3::Bound::<'py, T>::borrow_mut`
--> src/instance.rs
|
| pub fn borrow_mut(&self) -> PyRefMut<'py, T>
| ---------- required by a bound in this associated function
| where
| T: PyClass<Frozen = False>,
| ^^^^^^^^^^^^^^ required by this bound in `Bound::<'py, T>::borrow_mut`
error[E0271]: type mismatch resolving `<MutableBase as PyClass>::Frozen == True`
--> tests/ui/invalid_frozen_pyclass_borrow.rs:29:11
|
29 | class.get();
| ^^^ expected `True`, found `False`
|
note: required by a bound in `pyo3::Py::<T>::get`
--> src/instance.rs
|
| pub fn get(&self) -> &T
| --- required by a bound in this associated function
| where
| T: PyClass<Frozen = True> + Sync,
| ^^^^^^^^^^^^^ required by this bound in `Py::<T>::get`
error[E0271]: type mismatch resolving `<MutableBase as PyClass>::Frozen == True`
--> tests/ui/invalid_frozen_pyclass_borrow.rs:33:11
|
33 | class.get();
| ^^^ expected `True`, found `False`
|
note: required by a bound in `pyo3::Bound::<'py, T>::get`
--> src/instance.rs
|
| pub fn get(&self) -> &T
| --- required by a bound in this associated function
| where
| T: PyClass<Frozen = True> + Sync,
| ^^^^^^^^^^^^^ required by this bound in `Bound::<'py, T>::get`