Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full path for PyCell #1711

Merged
merged 1 commit into from Jul 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyo3-macros-backend/src/pyclass.rs
Expand Up @@ -538,7 +538,7 @@ fn impl_class(
const IS_BASETYPE: bool = #is_basetype;
const IS_SUBCLASS: bool = #is_subclass;

type Layout = PyCell<Self>;
type Layout = pyo3::PyCell<Self>;
type BaseType = #base;
type ThreadChecker = #thread_checker;

Expand Down
8 changes: 4 additions & 4 deletions tests/ui/invalid_pymethod_receiver.stderr
@@ -1,15 +1,15 @@
error[E0277]: the trait bound `i32: From<&pyo3::PyCell<MyClass>>` is not satisfied
error[E0277]: the trait bound `i32: From<&PyCell<MyClass>>` is not satisfied
--> $DIR/invalid_pymethod_receiver.rs:8:43
|
8 | fn method_with_invalid_self_type(slf: i32, py: Python, index: u32) {}
| ^^^ the trait `From<&pyo3::PyCell<MyClass>>` is not implemented for `i32`
| ^^^ the trait `From<&PyCell<MyClass>>` is not implemented for `i32`
|
= help: the following implementations were found:
<i32 as From<NonZeroI32>>
<i32 as From<bool>>
<i32 as From<i16>>
<i32 as From<i8>>
and 2 others
= note: required because of the requirements on the impl of `Into<i32>` for `&pyo3::PyCell<MyClass>`
= note: required because of the requirements on the impl of `TryFrom<&pyo3::PyCell<MyClass>>` for `i32`
= note: required because of the requirements on the impl of `Into<i32>` for `&PyCell<MyClass>`
= note: required because of the requirements on the impl of `TryFrom<&PyCell<MyClass>>` for `i32`
= note: required by `std::convert::TryFrom::try_from`