next solver: prefer to select impl candidates over global where-clause candidates - #162655
next solver: prefer to select impl candidates over global where-clause candidates#162655dianne wants to merge 1 commit into
Conversation
| // Don't winnow until `Certainty::Yes` -- we don't need to winnow until | ||
| // codegen, and only on the good path. | ||
| // Don't winnow until `Certainty::Yes` -- we don't need to winnow until constant evaluation or | ||
| // codegen. |
There was a problem hiding this comment.
not totally sure what to do with this comment, but seeing as it was wrong before, I'd like to update it in some way
| ( | ||
| CandidateSource::ParamEnv(ParamEnvSource::Global), | ||
| CandidateSource::Impl(_) | CandidateSource::BuiltinImpl(_), | ||
| ) => true, |
There was a problem hiding this comment.
maybe this could be more aggressive? I'm not sure what else would be needed, so I'm treating this as a targeted fix. so far, I haven't been able to find any examples that would still fail without this if const-to-pat resolved and evaluated consts in a clean environment (e.g. as it does when full gca is enabled)
| #![feature(const_trait_impl)] | ||
| #![feature(const_clone)] |
There was a problem hiding this comment.
this is for testing the preference for builtin impls over global where-clause candidates. I haven't found a way to do that without unstable features
| //@ revisions: current next | ||
| //@ ignore-compare-mode-next-solver (explicit revisions) | ||
| //@[next] compile-flags: -Znext-solver |
There was a problem hiding this comment.
could maybe get rid of the current-solver revision but I figured I'd include it as a sanity check
|
r? @lcnr or reassign |
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor |
Fixes #162331
Ideally we'd use a more appropriate typing environment when doing const-eval for const-to-pat, which would also fix that (since the problem clauses wouldn't be present to begin with). Being able to do that seems kind of far off, though, so here's a quick fix that (mostly) matches what the old solver does.