Skip to content

Commit

Permalink
Fix #4723: ambiguous associated item in #[pyclass]
Browse files Browse the repository at this point in the history
This uses the fix described in rust-lang/rust#57644
  • Loading branch information
LilyFoote committed Nov 21, 2024
1 parent 7fdbf5a commit 8aaabb2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pyo3-macros-backend/src/pyclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,10 @@ fn impl_complex_enum(
type Output = #pyo3_path::Bound<'py, Self::Target>;
type Error = #pyo3_path::PyErr;

fn into_pyobject(self, py: #pyo3_path::Python<'py>) -> ::std::result::Result<Self::Output, Self::Error> {
fn into_pyobject(self, py: #pyo3_path::Python<'py>) -> ::std::result::Result<
<Self as #pyo3_path::conversion::IntoPyObject>::Output,
<Self as #pyo3_path::conversion::IntoPyObject>::Error,
> {
match self {
#(#match_arms)*
}
Expand Down Expand Up @@ -2164,7 +2167,10 @@ impl<'a> PyClassImplsBuilder<'a> {
type Output = #pyo3_path::Bound<'py, Self::Target>;
type Error = #pyo3_path::PyErr;

fn into_pyobject(self, py: #pyo3_path::Python<'py>) -> ::std::result::Result<Self::Output, Self::Error> {
fn into_pyobject(self, py: #pyo3_path::Python<'py>) -> ::std::result::Result<
<Self as #pyo3_path::conversion::IntoPyObject>::Output,
<Self as #pyo3_path::conversion::IntoPyObject>::Error,
> {
#pyo3_path::Bound::new(py, self)
}
}
Expand Down

0 comments on commit 8aaabb2

Please sign in to comment.