error[E0271]: type mismatch resolving `::Mutability == Mutable` --> tests/ui/invalid_immutable_pyclass_borrow.rs:10:33 | 10 | let borrow = foo.as_ref(py).borrow_mut(); | ^^^^^^^^^^ expected struct `Mutable`, found struct `Immutable` | = note: required because of the requirements on the impl of `MutablePyClass` for `Foo` note: required by a bound in `PyCell::::borrow_mut` --> src/pycell.rs | | T: MutablePyClass, | ^^^^^^^^^^^^^^ required by this bound in `PyCell::::borrow_mut` error[E0271]: type mismatch resolving `::Mutability == Mutable` --> tests/ui/invalid_immutable_pyclass_borrow.rs:20:35 | 20 | let borrow = child.as_ref(py).borrow_mut(); | ^^^^^^^^^^ expected struct `Mutable`, found struct `Immutable` | = note: required because of the requirements on the impl of `MutablePyClass` for `ImmutableChild` note: required by a bound in `PyCell::::borrow_mut` --> src/pycell.rs | | T: MutablePyClass, | ^^^^^^^^^^^^^^ required by this bound in `PyCell::::borrow_mut`