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

Improve diagnostics for HostEffectPredicate in the new solver #132345

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

compiler-errors
Copy link
Member

@compiler-errors compiler-errors commented Oct 30, 2024

Adds derived cause for host effect predicates. Some diagnostics regress, but that's connected to the fact that our predicate visitor doesn't play well with aliases just yet.

@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 Oct 30, 2024
@compiler-errors compiler-errors changed the title Improve diagnostics for HostEffectPredicate in the new solver Improve diagnostics for HostEffectPredicate in the new solver Oct 30, 2024
@bors
Copy link
Contributor

bors commented Oct 31, 2024

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

@bors
Copy link
Contributor

bors commented Nov 3, 2024

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

@compiler-errors compiler-errors marked this pull request as ready for review December 10, 2024 22:10
@rustbot
Copy link
Collaborator

rustbot commented Dec 10, 2024

Some changes occurred to the core trait solver

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

@compiler-errors
Copy link
Member Author

r? lcnr 

@@ -16,6 +16,11 @@ error[E0277]: the trait bound `T: ~const Bar` is not satisfied
LL | type Assoc<T> = C<T>
| ^^^^
|
note: required for `C<T>` to implement `~const Bar`
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the net effect of the change.

@@ -14,9 +14,9 @@ trait Trait {

const fn unqualified<T: Trait>() {
T::Assoc::func();
//~^ ERROR the trait bound `T: ~const Trait` is not satisfied
//~^ ERROR the trait bound `<T as Trait>::Assoc: ~const Trait` is not satisfied
Copy link
Member Author

@compiler-errors compiler-errors Dec 10, 2024

Choose a reason for hiding this comment

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

We don't treat the GAT where clauses as where clauses for a goal source... should we?

Copy link
Contributor

Choose a reason for hiding this comment

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

depends on where and how we prove them. I think for diagnostics, the answer should be yes, for cycle handling maybe no?

impl_const_condition_bound_count,
parent_host_pred,
));
impl_const_condition_bound_count += 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

why use a separate counter here? We should only ever track one of the two, shouldn't we?

@lcnr
Copy link
Contributor

lcnr commented Dec 17, 2024

r=me after nit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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.

4 participants