Skip to content

cycle handling: mirror old solver - #163496

Merged
rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
lcnr:weaken-cycle-handling
Oct 1, 2026
Merged

rust-bors[bot] merged 2 commits into
rust-lang:mainfrom
lcnr:weaken-cycle-handling

Conversation

@lcnr

@lcnr lcnr commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

I hate other people being right :<

When stabilizing the new solver, we really want to minimize the amount of things we're stabilizing. This far more closely matches the old solver while still being somewhat principled. I do think the approach we had before this PR is closer to the final state we want, but I am far from confident that this is the case and this gives us more room to experiment until then.

The rules are as follows: a cycle is coinductive if there's at least one "coinductive trait goal" involved and the only other involved goals are Projection goals.

r? types cc @jackh726

@rustbot

rustbot commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

@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 Sep 29, 2026
@lcnr
lcnr force-pushed the weaken-cycle-handling branch from 9ed2cc0 to 14d09db Compare September 29, 2026 16:49
@rust-log-analyzer

This comment has been minimized.

@jackh726

Copy link
Copy Markdown
Member

This seems fairly straightforward. The only minor comment: I wonder if it's worth to split this into two commits: one "prep" commit and one that actually changes the behavior.

r? jackh726
r=me

@rustbot rustbot assigned jackh726 and unassigned spastorino Sep 29, 2026
@lcnr

lcnr commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

The only minor comment: I wonder if it's worth to split this into two commits: one "prep" commit and one that actually changes the behavior.

would generally be yeah, rn that would require temporary changes to step_kind_to_nested, so it doesn't feel worth it to me. The only behavior change is in fn step_kind_to_nested.

Also added a regression test for one way the old and new solver diverge wrt cycle handling (found via an llm)

@bors r+ rollup

@rust-bors

rust-bors Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 14d09db has been approved by lcnr

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 30, 2026
@lcnr

lcnr commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

@bors r=jackh726

@rust-bors

rust-bors Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 14d09db has been approved by jackh726

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 30, 2026
@rust-bors

rust-bors Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

⚠️ A new commit 582ece71ba43325ffd90211e5a8af97565e6e2b2 was pushed.

This pull request was unapproved.

@lcnr

lcnr commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

@bors r=jackh726 rollup

@rust-bors

rust-bors Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 582ece7 has been tentatively approved by jackh726

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 30, 2026
@rust-log-analyzer

This comment has been minimized.

@lcnr
lcnr force-pushed the weaken-cycle-handling branch from 582ece7 to 7238eac Compare September 30, 2026 07:26
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 30, 2026
@rust-bors

rust-bors Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

⚠️ A new commit 7238eac0f61995d51d0fc5165535f13dbfc457d1 was pushed.

This pull request was unapproved.

@lcnr

lcnr commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

@bors r=jackh726 rollup

@lcnr
lcnr force-pushed the weaken-cycle-handling branch from 7238eac to 654d664 Compare September 30, 2026 08:14
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Sep 30, 2026
@rust-bors

rust-bors Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

⚠️ A new commit 654d6642d918149742558744798c2cdce3996999 was pushed.

This pull request was unapproved.

@lcnr

lcnr commented Sep 30, 2026

Copy link
Copy Markdown
Contributor Author

@bors r=jackh726 rollup

@rust-bors

rust-bors Bot commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 654d664 has been tentatively approved by jackh726

It will be put into the queue for this repository once PR CI succeeds.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 30, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 30, 2026
…h726

cycle handling: mirror old solver

I hate other people being right :<

When stabilizing the new solver, we really want to minimize the amount of things we're stabilizing. This far more closely matches the old solver while still being somewhat principled. I do think the approach we had before this PR is closer to the final state we want, but I am far from confident that this is the case and this gives us more room to experiment until then.

The rules are as follows: a cycle is coinductive if there's at least one "coinductive trait goal" involved and the only other involved goals are `Projection` goals.

r? types cc @jackh726
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 30, 2026
…h726

cycle handling: mirror old solver

I hate other people being right :<

When stabilizing the new solver, we really want to minimize the amount of things we're stabilizing. This far more closely matches the old solver while still being somewhat principled. I do think the approach we had before this PR is closer to the final state we want, but I am far from confident that this is the case and this gives us more room to experiment until then.

The rules are as follows: a cycle is coinductive if there's at least one "coinductive trait goal" involved and the only other involved goals are `Projection` goals.

r? types cc @jackh726
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 30, 2026
…h726

cycle handling: mirror old solver

I hate other people being right :<

When stabilizing the new solver, we really want to minimize the amount of things we're stabilizing. This far more closely matches the old solver while still being somewhat principled. I do think the approach we had before this PR is closer to the final state we want, but I am far from confident that this is the case and this gives us more room to experiment until then.

The rules are as follows: a cycle is coinductive if there's at least one "coinductive trait goal" involved and the only other involved goals are `Projection` goals.

r? types cc @jackh726
rust-bors Bot pushed a commit that referenced this pull request Sep 30, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #163532 (rustc_codegen_cranelift subtree update)
 - #163534 (miri subtree update)
 - #163279 (const and NonZero impl for clamp_magnitude())
 - #162900 (Some refactorings around metadata encoding)
 - #163455 (Don't use the metadata based crate_hash for rustdoc runs)
 - #163483 (Bump bootstrap compiler to 1.100.0 beta)
 - #159798 (Attribute documentation for cfg_attr)
 - #163368 (Don't build format string suggestions from `concat!` offsets)
 - #163375 (Update expect messages in library/std/src/os/unix/net/ following Rust's `expect` guidance)
 - #163405 (Remove some #[linkage] options)
 - #163470 (Miscellaneous attr error stuff)
 - #163489 (expose Rc::is_unique)
 - #163492 (x86 and x86_64: cleanup some callconv code)
 - #163496 (cycle handling: mirror old solver)
 - #163509 (Use more default field values in `Resolver`)
 - #163519 (Forbid  `Reborrow` impls for types with destructors)
 - #163520 (Cast cleanups)
 - #163524 (Document `Result` case for the `arena_cache` query modifier)

Failed merges:

 - #163547 ([beta] rustfmt backport)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Sep 30, 2026
…h726

cycle handling: mirror old solver

I hate other people being right :<

When stabilizing the new solver, we really want to minimize the amount of things we're stabilizing. This far more closely matches the old solver while still being somewhat principled. I do think the approach we had before this PR is closer to the final state we want, but I am far from confident that this is the case and this gives us more room to experiment until then.

The rules are as follows: a cycle is coinductive if there's at least one "coinductive trait goal" involved and the only other involved goals are `Projection` goals.

r? types cc @jackh726
rust-bors Bot pushed a commit that referenced this pull request Sep 30, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #163532 (rustc_codegen_cranelift subtree update)
 - #163534 (miri subtree update)
 - #163279 (const and NonZero impl for clamp_magnitude())
 - #162900 (Some refactorings around metadata encoding)
 - #163455 (Don't use the metadata based crate_hash for rustdoc runs)
 - #159798 (Attribute documentation for cfg_attr)
 - #162921 (make mips64 `Complex` GCC-compatible)
 - #163368 (Don't build format string suggestions from `concat!` offsets)
 - #163375 (Update expect messages in library/std/src/os/unix/net/ following Rust's `expect` guidance)
 - #163405 (Remove some #[linkage] options)
 - #163470 (Miscellaneous attr error stuff)
 - #163489 (expose Rc::is_unique)
 - #163492 (x86 and x86_64: cleanup some callconv code)
 - #163496 (cycle handling: mirror old solver)
 - #163509 (Use more default field values in `Resolver`)
 - #163519 (Forbid  `Reborrow` impls for types with destructors)
 - #163520 (Cast cleanups)
 - #163524 (Document `Result` case for the `arena_cache` query modifier)
rust-bors Bot pushed a commit that referenced this pull request Sep 30, 2026
…uwer

Rollup of 18 pull requests

Successful merges:

 - #163532 (rustc_codegen_cranelift subtree update)
 - #163534 (miri subtree update)
 - #163279 (const and NonZero impl for clamp_magnitude())
 - #162900 (Some refactorings around metadata encoding)
 - #163455 (Don't use the metadata based crate_hash for rustdoc runs)
 - #159798 (Attribute documentation for cfg_attr)
 - #162921 (make mips64 `Complex` GCC-compatible)
 - #163368 (Don't build format string suggestions from `concat!` offsets)
 - #163375 (Update expect messages in library/std/src/os/unix/net/ following Rust's `expect` guidance)
 - #163405 (Remove some #[linkage] options)
 - #163470 (Miscellaneous attr error stuff)
 - #163489 (expose Rc::is_unique)
 - #163492 (x86 and x86_64: cleanup some callconv code)
 - #163496 (cycle handling: mirror old solver)
 - #163509 (Use more default field values in `Resolver`)
 - #163519 (Forbid  `Reborrow` impls for types with destructors)
 - #163520 (Cast cleanups)
 - #163524 (Document `Result` case for the `arena_cache` query modifier)
rust-bors Bot pushed a commit that referenced this pull request Oct 1, 2026
Rollup of 20 pull requests

Successful merges:

 - #163279 (const and NonZero impl for clamp_magnitude())
 - #163081 (Provide more context on "not general enough" error)
 - #163455 (Don't use the metadata based crate_hash for rustdoc runs)
 - #159798 (Attribute documentation for cfg_attr)
 - #162921 (make mips64 `Complex` GCC-compatible)
 - #163368 (Don't build format string suggestions from `concat!` offsets)
 - #163375 (Update expect messages in library/std/src/os/unix/net/ following Rust's `expect` guidance)
 - #163470 (Miscellaneous attr error stuff)
 - #163489 (expose Rc::is_unique)
 - #163492 (x86 and x86_64: cleanup some callconv code)
 - #163496 (cycle handling: mirror old solver)
 - #163509 (Use more default field values in `Resolver`)
 - #163519 (Forbid  `Reborrow` impls for types with destructors)
 - #163520 (Cast cleanups)
 - #163524 (Document `Result` case for the `arena_cache` query modifier)
 - #163546 (PassWrapper: adapt for new PassPlugin load method)
 - #163551 (Add libs-nominated triagebot config)
 - #163559 (Suggest `#[unsafe(no_mangle)]` for entry points in `no_std` binaries)
 - #163564 (rustc-dev-guide subtree update)
 - #163568 (remove dead cfg_select! arm)
@rust-bors
rust-bors Bot merged commit 77efc48 into rust-lang:main Oct 1, 2026
13 checks passed
@rustbot rustbot added this to the 1.101.0 milestone Oct 1, 2026
rust-bors Bot pushed a commit that referenced this pull request Oct 1, 2026
Rollup merge of #163496 - lcnr:weaken-cycle-handling, r=jackh726

cycle handling: mirror old solver

I hate other people being right :<

When stabilizing the new solver, we really want to minimize the amount of things we're stabilizing. This far more closely matches the old solver while still being somewhat principled. I do think the approach we had before this PR is closer to the final state we want, but I am far from confident that this is the case and this gives us more room to experiment until then.

The rules are as follows: a cycle is coinductive if there's at least one "coinductive trait goal" involved and the only other involved goals are `Projection` goals.

r? types cc @jackh726
RalfJung pushed a commit to RalfJung/miri that referenced this pull request Oct 1, 2026
Rollup of 20 pull requests

Successful merges:

 - rust-lang/rust#163279 (const and NonZero impl for clamp_magnitude())
 - rust-lang/rust#163081 (Provide more context on "not general enough" error)
 - rust-lang/rust#163455 (Don't use the metadata based crate_hash for rustdoc runs)
 - rust-lang/rust#159798 (Attribute documentation for cfg_attr)
 - rust-lang/rust#162921 (make mips64 `Complex` GCC-compatible)
 - rust-lang/rust#163368 (Don't build format string suggestions from `concat!` offsets)
 - rust-lang/rust#163375 (Update expect messages in library/std/src/os/unix/net/ following Rust's `expect` guidance)
 - rust-lang/rust#163470 (Miscellaneous attr error stuff)
 - rust-lang/rust#163489 (expose Rc::is_unique)
 - rust-lang/rust#163492 (x86 and x86_64: cleanup some callconv code)
 - rust-lang/rust#163496 (cycle handling: mirror old solver)
 - rust-lang/rust#163509 (Use more default field values in `Resolver`)
 - rust-lang/rust#163519 (Forbid  `Reborrow` impls for types with destructors)
 - rust-lang/rust#163520 (Cast cleanups)
 - rust-lang/rust#163524 (Document `Result` case for the `arena_cache` query modifier)
 - rust-lang/rust#163546 (PassWrapper: adapt for new PassPlugin load method)
 - rust-lang/rust#163551 (Add libs-nominated triagebot config)
 - rust-lang/rust#163559 (Suggest `#[unsafe(no_mangle)]` for entry points in `no_std` binaries)
 - rust-lang/rust#163564 (rustc-dev-guide subtree update)
 - rust-lang/rust#163568 (remove dead cfg_select! arm)
github-actions Bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request Oct 5, 2026
Rollup of 20 pull requests

Successful merges:

 - rust-lang/rust#163279 (const and NonZero impl for clamp_magnitude())
 - rust-lang/rust#163081 (Provide more context on "not general enough" error)
 - rust-lang/rust#163455 (Don't use the metadata based crate_hash for rustdoc runs)
 - rust-lang/rust#159798 (Attribute documentation for cfg_attr)
 - rust-lang/rust#162921 (make mips64 `Complex` GCC-compatible)
 - rust-lang/rust#163368 (Don't build format string suggestions from `concat!` offsets)
 - rust-lang/rust#163375 (Update expect messages in library/std/src/os/unix/net/ following Rust's `expect` guidance)
 - rust-lang/rust#163470 (Miscellaneous attr error stuff)
 - rust-lang/rust#163489 (expose Rc::is_unique)
 - rust-lang/rust#163492 (x86 and x86_64: cleanup some callconv code)
 - rust-lang/rust#163496 (cycle handling: mirror old solver)
 - rust-lang/rust#163509 (Use more default field values in `Resolver`)
 - rust-lang/rust#163519 (Forbid  `Reborrow` impls for types with destructors)
 - rust-lang/rust#163520 (Cast cleanups)
 - rust-lang/rust#163524 (Document `Result` case for the `arena_cache` query modifier)
 - rust-lang/rust#163546 (PassWrapper: adapt for new PassPlugin load method)
 - rust-lang/rust#163551 (Add libs-nominated triagebot config)
 - rust-lang/rust#163559 (Suggest `#[unsafe(no_mangle)]` for entry points in `no_std` binaries)
 - rust-lang/rust#163564 (rustc-dev-guide subtree update)
 - rust-lang/rust#163568 (remove dead cfg_select! arm)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

5 participants