Implement some more new solver candidates and fix some bugs#107061
Merged
bors merged 6 commits intorust-lang:masterfrom Jan 21, 2023
Merged
Implement some more new solver candidates and fix some bugs#107061bors merged 6 commits intorust-lang:masterfrom
bors merged 6 commits intorust-lang:masterfrom
Conversation
Collaborator
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
compiler-errors
commented
Jan 19, 2023
9291570 to
277711e
Compare
compiler-errors
commented
Jan 19, 2023
This comment has been minimized.
This comment has been minimized.
277711e to
ed6aebb
Compare
Contributor
Author
|
@bors r=lcnr |
Collaborator
Contributor
|
@bors rollup (limited to new solver) |
lcnr
reviewed
Jan 20, 2023
| // HACK: `_: Trait` is ambiguous, because it may be satisfied via a builtin rule, | ||
| // object bound, alias bound, etc. We are unable to determine this until we can at | ||
| // least structually resolve the type one layer. | ||
| if goal.predicate.self_ty().is_ty_var() { |
Contributor
There was a problem hiding this comment.
assembly can now always ICE on Bound and Infer(TyVar) so that it's clearer why we don't have to consider stuff ambig for infer vars
compiler-errors
added a commit
to compiler-errors/rust
that referenced
this pull request
Jan 20, 2023
…didates-3, r=lcnr Implement some more new solver candidates and fix some bugs First, fix some bugs: 1. `IndexVec::drain_enumerated(a..b)` does not give us an iterator of index keys + items enumerated from `a..b`, but from `0..(b-a)`... That caused a bug. See first commit for the fix. 2. Implement the `_: Trait` ambiguity hack. I put it in assemble, let me know if it should live elsewhere. This is important, since we otherwise consider `_: Sized` to have no solutions, and nothing passes! 3. Swap `Ambiguity` and `Unimplemented` cases for the new solver. Sorry for accidentally swapping them 😄 4. Check GATs' own predicates during projection confirmation. Then implement a few builtin traits: 5. Implement `PointerSized`. Pretty independent. 6. Implement `Fn` family of traits for fnptr, fndef, and closures. Closures are currently broken because `FulfillCtxt::relationships` is intentionally left unimplemented. See comment in the test. r? `@lcnr`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jan 20, 2023
…didates-3, r=lcnr Implement some more new solver candidates and fix some bugs First, fix some bugs: 1. `IndexVec::drain_enumerated(a..b)` does not give us an iterator of index keys + items enumerated from `a..b`, but from `0..(b-a)`... That caused a bug. See first commit for the fix. 2. Implement the `_: Trait` ambiguity hack. I put it in assemble, let me know if it should live elsewhere. This is important, since we otherwise consider `_: Sized` to have no solutions, and nothing passes! 3. Swap `Ambiguity` and `Unimplemented` cases for the new solver. Sorry for accidentally swapping them 😄 4. Check GATs' own predicates during projection confirmation. Then implement a few builtin traits: 5. Implement `PointerSized`. Pretty independent. 6. Implement `Fn` family of traits for fnptr, fndef, and closures. Closures are currently broken because `FulfillCtxt::relationships` is intentionally left unimplemented. See comment in the test. r? ``@lcnr``
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jan 21, 2023
…mpiler-errors Rollup of 9 pull requests Successful merges: - rust-lang#104154 (Change `bindings_with_variant_name` to deny-by-default) - rust-lang#104347 (diagnostics: suggest changing `s@self::{macro}`@::macro`` for exported) - rust-lang#104672 (Unify stable and unstable sort implementations in same core module) - rust-lang#107048 (check for x version updates) - rust-lang#107061 (Implement some more new solver candidates and fix some bugs) - rust-lang#107095 (rustdoc: remove redundant CSS selector `.sidebar .current`) - rust-lang#107112 (Fix typo in opaque_types.rs) - rust-lang#107124 (fix check macro expansion) - rust-lang#107131 (rustdoc: use CSS inline layout for radio line instead of flexbox) 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.
First, fix some bugs:
IndexVec::drain_enumerated(a..b)does not give us an iterator of index keys + items enumerated froma..b, but from0..(b-a)... That caused a bug. See first commit for the fix._: Traitambiguity hack. I put it in assemble, let me know if it should live elsewhere. This is important, since we otherwise consider_: Sizedto have no solutions, and nothing passes!AmbiguityandUnimplementedcases for the new solver. Sorry for accidentally swapping them 😄Then implement a few builtin traits:
PointerSized. Pretty independent.Fnfamily of traits for fnptr, fndef, and closures. Closures are currently broken becauseFulfillCtxt::relationshipsis intentionally left unimplemented. See comment in the test.r? @lcnr