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

Regression using Self inside #[pymethods] arguments #1070

Closed
davidhewitt opened this issue Jul 28, 2020 · 0 comments · Fixed by #1071
Closed

Regression using Self inside #[pymethods] arguments #1070

davidhewitt opened this issue Jul 28, 2020 · 0 comments · Fixed by #1071
Labels
Milestone

Comments

@davidhewitt
Copy link
Member

This snippet used to work on pyo3 0.8:

#[pyclass]
struct MyClass { }

#[pymethods]
impl MyClass {
    fn takes_self(&self, other: &Self) { }
}

With 0.11.1 it fails with:

error[E0411]: cannot find type `Self` in this scope=================>  ] 35/36: ...
  --> src/lib.rs:14:34
   |
14 |     fn takes_self(&self, other: &Self) { }
   |                                  ^^^^ `Self` is only available in impls, traits, and type definitions

This was originally reported in #791 (comment), which also identifies possible guilty line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant