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

Return nested obligations from canonical response var unification #109493

Merged
merged 2 commits into from
Mar 24, 2023

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Mar 22, 2023

Handle alias-eq obligations being emitted from instantiate_and_apply_query_response in:

  • EvalCtxt - by processing the nested obligations in the next loop by new_goals
  • FulfillCtxt - by adding the nested obligations to the fulfillment's pending obligations
  • InferCtxt::evaluate_obligation - by returning EvaluationResult::EvaluatedToAmbig (boo 👎, see the FIXME) same behavior as above, since we use fulfillment and select_where_possible

The only one that's truly sketchy is evaluate_obligation, but it's not hard to modify this behavior moving forward.

From #109037, I think a smaller repro could be crafted if I were smarter, but I am not, so I just took this from #105878.

r? @lcnr cc @BoxyUwU

@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 Mar 22, 2023
@rustbot
Copy link
Collaborator

rustbot commented Mar 22, 2023

Some changes occurred to the core trait solver

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

@compiler-errors compiler-errors force-pushed the new-solver-vars-obligations branch from d2377ca to 3b3c8c9 Compare March 22, 2023 16:49
@bors
Copy link
Contributor

bors commented Mar 23, 2023

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

Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

r=me after dealing with comment if you want

@@ -81,10 +81,18 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {

if self.tcx.trait_solver_next() {
self.probe(|snapshot| {
if let Ok((_, certainty)) =
Copy link
Contributor

Choose a reason for hiding this comment

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

i think we already talked about that before, but is there a reason we can't use the FulfillmentContext and select_where_possible?

Copy link
Member Author

@compiler-errors compiler-errors Mar 23, 2023

Choose a reason for hiding this comment

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

We don't bubble up overflow correctly when using a fulfillment context, but we're actually already using a fulfillment context for the evaluate queries in SelectionCtxt.... so seems alright for now, I can migrate it to use fulfillment. I'll leave a FIXME.

@compiler-errors compiler-errors force-pushed the new-solver-vars-obligations branch from 3b3c8c9 to 1680334 Compare March 23, 2023 19:22
@compiler-errors
Copy link
Member Author

@bors r=lcnr

@bors
Copy link
Contributor

bors commented Mar 23, 2023

📌 Commit 1680334 has been approved by lcnr

It is now in the queue for this repository.

@bors bors 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 Mar 23, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 24, 2023
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#108629 (rustdoc: add support for type filters in arguments and generics)
 - rust-lang#108924 (panic_immediate_abort requires abort as a panic strategy)
 - rust-lang#108961 (Refine error spans for const args in hir typeck)
 - rust-lang#108986 (sync LVI tests)
 - rust-lang#109142 (Add block-based mutex unlocking example)
 - rust-lang#109368 (fix typo in the creation of OpenOption for RustyHermit)
 - rust-lang#109493 (Return nested obligations from canonical response var unification)
 - rust-lang#109515 (Add AixLinker to support linking on AIX)
 - rust-lang#109536 (resolve: Rename some cstore methods to match queries and add comments)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1c7ef3b into rust-lang:master Mar 24, 2023
@rustbot rustbot added this to the 1.70.0 milestone Mar 24, 2023
@bors
Copy link
Contributor

bors commented Mar 24, 2023

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

@bors bors 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 Mar 24, 2023
@compiler-errors compiler-errors deleted the new-solver-vars-obligations branch August 11, 2023 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

4 participants