Skip to content
New issue

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

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

Already on GitHub? # to your account

change definitely unproductive cycles to error #137314

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

lcnr
Copy link
Contributor

@lcnr lcnr commented Feb 20, 2025

builds on top of #136824 by adding a third variant to PathKind for paths which may change to be coinductive in the future but must not be so right now. Most notably, impl where-clauses of not yet coinductive traits.

With this, we can change cycles which are definitely unproductive to a proper error. This fixes rust-lang/trait-system-refactor-initiative#114

TODO 🤔

  • we should probably make sure that the cycles we treat as Inductive actually all are as changing them later will be breaking and it can even be unsound if encountered in coherence

r? @compiler-errors @nikomatsakis

lcnr added 5 commits February 19, 2025 11:05
A cycle was previously coinductive if all steps were coinductive.
Change this to instead considerm cycles to be coinductive if they
step through at least one where-bound of an impl of a coinductive
trait goal.
they don't detect any bugs in the search graph. We instead check
for these via `search_graph_fuzz`.
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Feb 20, 2025
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Feb 23, 2025

☔ The latest upstream changes (presumably #137466) made this pull request unmergeable. Please resolve the merge conflicts.

@lcnr lcnr changed the title Change definitely unproductive cycles to error change definitely unproductive cycles to error Feb 26, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

inductive cycles as ambig causes unintended breakage
5 participants