Make alias bounds sound in the new solver (take 2)#110673
Merged
bors merged 2 commits intorust-lang:masterfrom May 10, 2023
Merged
Make alias bounds sound in the new solver (take 2)#110673bors merged 2 commits intorust-lang:masterfrom
bors merged 2 commits intorust-lang:masterfrom
Conversation
Collaborator
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
Collaborator
|
☔ The latest upstream changes (presumably #110674) made this pull request unmergeable. Please resolve the merge conflicts. |
8152fc9 to
25d8860
Compare
Collaborator
|
☔ The latest upstream changes (presumably #110821) made this pull request unmergeable. Please resolve the merge conflicts. |
25d8860 to
c0bf6ad
Compare
lcnr
reviewed
May 9, 2023
Contributor
lcnr
left a comment
There was a problem hiding this comment.
nits, then r=me. I am not completely happy with having default methods on GoalKind but whatever, not sure whether having these on EvalCtxt is cleaner or not
2bfcf93 to
59c0fcc
Compare
This comment has been minimized.
This comment has been minimized.
59c0fcc to
3a863e5
Compare
Contributor
Author
|
@bors r=lcnr rollup (only affects new solver) |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
May 10, 2023
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#110673 (Make alias bounds sound in the new solver (take 2)) - rust-lang#110747 (Encode types in SMIR) - rust-lang#111095 (Correctly handle associated items of a trait inside a `#[doc(hidden)]` item) - rust-lang#111381 (Keep encoding attributes for closures) - rust-lang#111408 (Fix incorrect implication of transmuting slices) - rust-lang#111410 (Switch to `EarlyBinder` for `thir_abstract_const` query) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make alias bounds sound in the new solver (in a way that does not require coinduction) by only considering them for projection types whose corresponding trait refs come from a param-env candidate.
That is, given
<T as Trait>::Assoc: Bound, we only really need to consider the alias bound ifT: Traitis satisfied via a param-env candidate. If it's instead satisfied, e.g., via an user provided impl candidate or a , then that impl should have a concrete type to which we could otherwise normalize<T as Trait>::Assoc, and that concrete type is then responsible to prove theBoundon it.Similar consideration is given to opaque types, since we only need to consider alias bounds if we're not in reveal-all mode, since similarly we'd be able to reveal the opaque types and prove any bounds that way.
This does not remove that hacky "eager projection replacement" logic from object bounds, which are somewhat like alias bounds. But removing this eager normalization behavior (added in #108333) would require full coinduction to be enabled. Compare to #110628, which does remove this object-bound custom logic but requires coinduction to be sound.
r? @lcnr