-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Implement some more new solver candidates and fix some bugs #107061
Implement some more new solver candidates and fix some bugs #107061
Conversation
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
9291570
to
277711e
Compare
This comment has been minimized.
This comment has been minimized.
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.
nits, then r=me
277711e
to
ed6aebb
Compare
@bors r=lcnr |
@bors rollup (limited to new solver) |
// 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() { |
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.
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
…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`
…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``
…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
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._: 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!Ambiguity
andUnimplemented
cases for the new solver. Sorry for accidentally swapping them 😄Then implement a few builtin traits:
PointerSized
. Pretty independent.Fn
family of traits for fnptr, fndef, and closures. Closures are currently broken becauseFulfillCtxt::relationships
is intentionally left unimplemented. See comment in the test.r? @lcnr