-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
ICE in new solver if we see an inference variable #107286
Conversation
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
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.
I hate fresh inference vars :<
I definitely think that once they're removed, we should only bug
on ty::Infer(ty::TyVar(..))
so that it's clear that int and float infer vars have to be handled.
Exhaustively matching on the 3 fresh vars + TyVar
is probably a bit cumbersome but imo may still be worth it for now.
I would prefer to do that but it's fine to keep this as is if you disagree here.
r=me after nits
1209870
to
661f54e
Compare
I updated this to exhaustively match on the infer kinds, I actually agree and prefer that. I'll wait until the PR I mentioned matches so I can fix that usage too. |
661f54e
to
0f24e11
Compare
@bors r=lcnr rollup (only affects new solver) |
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#106407 (Improve proc macro attribute diagnostics) - rust-lang#106960 (Teach parser to understand fake anonymous enum syntax) - rust-lang#107085 (Custom MIR: Support binary and unary operations) - rust-lang#107086 (Print PID holding bootstrap build lock on Linux) - rust-lang#107175 (Fix escaping inference var ICE in `point_at_expr_source_of_inferred_type`) - rust-lang#107204 (suggest qualifying bare associated constants) - rust-lang#107248 (abi: add AddressSpace field to Primitive::Pointer ) - rust-lang#107272 (Implement ObjectSafe and WF in the new solver) - rust-lang#107285 (Implement `Generator` and `Future` in the new solver) - rust-lang#107286 (ICE in new solver if we see an inference variable) - rust-lang#107313 (Add Style Team Triagebot config) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 11 pull requests Successful merges: - rust-lang#106407 (Improve proc macro attribute diagnostics) - rust-lang#106960 (Teach parser to understand fake anonymous enum syntax) - rust-lang#107085 (Custom MIR: Support binary and unary operations) - rust-lang#107086 (Print PID holding bootstrap build lock on Linux) - rust-lang#107175 (Fix escaping inference var ICE in `point_at_expr_source_of_inferred_type`) - rust-lang#107204 (suggest qualifying bare associated constants) - rust-lang#107248 (abi: add AddressSpace field to Primitive::Pointer ) - rust-lang#107272 (Implement ObjectSafe and WF in the new solver) - rust-lang#107285 (Implement `Generator` and `Future` in the new solver) - rust-lang#107286 (ICE in new solver if we see an inference variable) - rust-lang#107313 (Add Style Team Triagebot config) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
By construction, we do not expect to see any
ty::Infer(ty::TyVar(_))
inference types in the solver (we treat this as ambiguous, since we need to be able to structurally resolve the self type at least one layer to assemble candidates for it). Additionally, since we're doing no freshening, we also don't expect to see any fresh vars of any kind in the solver.Let's make that an ICE so we can catch any mistakes.
When #107282 lands, we should also ICE there too if we see a non-int/float infer.
r? @lcnr