Skip to content

Conversation

@davidhewitt
Copy link
Member

This is a slightly modified version of the patch suggested rust-lang/rust#149081 (comment)

There is a Rust compiler bug currently on beta which causes it to crash compiling PyO3. The bug seems to be related to implied bounds on a generic parameter introduced by the bounds being added via an associated type constraint.

In this PR, where possible instead of adding implied bounds I've instead removed the generic parameter and referred to it via the associated type. This seems slightly cleaner anyway, in my opinion.

This probably is worth shipping in PyO3 0.27.2

@davidhewitt davidhewitt changed the title Avoid introducing generic parameter with implied bounds from an associated type relation avoid introducing generic parameter with implied bounds from an associated type relation Nov 21, 2025
@davidhewitt davidhewitt changed the title avoid introducing generic parameter with implied bounds from an associated type relation Avoid introducing generic parameter with implied bounds from an associated type relation Nov 21, 2025
Copy link
Member

@bschoenmaeckers bschoenmaeckers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks cleaner indeed 👍

@davidhewitt davidhewitt added this pull request to the merge queue Nov 21, 2025
Merged via the queue into PyO3:main with commit a5a6538 Nov 21, 2025
41 of 42 checks passed
@davidhewitt davidhewitt deleted the avoid-implied-bounds-on-generic branch November 21, 2025 12:17
davidhewitt added a commit that referenced this pull request Nov 23, 2025
…iated type relation (#5638)

* avoid introducing generic parameter with implied bounds from an associated type relation

* newsfragment
davidhewitt added a commit that referenced this pull request Nov 23, 2025
…iated type relation (#5638)

* avoid introducing generic parameter with implied bounds from an associated type relation

* newsfragment
@davidhewitt davidhewitt mentioned this pull request Nov 23, 2025
davidhewitt added a commit that referenced this pull request Nov 30, 2025
…iated type relation (#5638)

* avoid introducing generic parameter with implied bounds from an associated type relation

* newsfragment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants