-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Conversation
HostEffectPredicate
in the new solver
☔ The latest upstream changes (presumably #132371) made this pull request unmergeable. Please resolve the merge conflicts. |
0cbc3ae
to
bb76b62
Compare
☔ The latest upstream changes (presumably #132479) made this pull request unmergeable. Please resolve the merge conflicts. |
bb76b62
to
b921c6a
Compare
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
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` |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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?
r=me after nit |
b921c6a
to
360bd32
Compare
@@ -1,10 +1,10 @@ | |||
error[E0277]: the trait bound `<T as Trait>::Assoc<U>: ~const Trait` is not satisfied | |||
error[E0277]: the trait bound `U: ~const Other` is not satisfied |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally these would be reported as derived causes, i.e. U: ~const Other
must hold for <T as Trait>::Assoc<U>: ~const Trait
to hold. I'm not going to touch the obligation cause code further in this PR though.
Needs another review for the last commit, cc @lcnr |
👍 @bors r+ rollup |
Conflicts w/ that other PR, so I'm gonna r- this for now. @bors r- |
☔ The latest upstream changes (presumably #134716) made this pull request unmergeable. Please resolve the merge conflicts. |
360bd32
to
ebdf19a
Compare
Rebased @bors r=lcnr |
Improve diagnostics for `HostEffectPredicate` in the new solver 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.
Rollup of 9 pull requests Successful merges: - rust-lang#131830 (Add support for wasm exception handling to Emscripten target) - rust-lang#132345 (Improve diagnostics for `HostEffectPredicate` in the new solver) - rust-lang#134568 (Release notes for 1.84.0) - rust-lang#134744 (Don't ice on bad transmute in typeck in new solver) - rust-lang#135090 (Suggest to replace tuple constructor through projection) - rust-lang#135116 (rustdoc: Fix mismatched capitalization in sidebar) - rust-lang#135126 (mark deprecated option as deprecated in rustc_session to remove copypasta and small refactor) - rust-lang#135139 ([generic_assert] Constify methods used by the formatting system) - rust-lang#135170 (Update triagebot.toml: celinval vacation is over) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#132345 - compiler-errors:fx-diag, r=lcnr Improve diagnostics for `HostEffectPredicate` in the new solver 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.
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.