Pull out logic from #111131, plus some new logic in EvalCtxt::normalize_opaque_type

Co-authored-by: lcnr <rust@lcnr.de>
This commit is contained in:
Michael Goulet 2023-05-09 18:56:43 +00:00
parent 7664dfe433
commit 4d80b8090c
13 changed files with 122 additions and 43 deletions

View file

@ -24,6 +24,7 @@ mod assembly;
mod canonicalize;
mod eval_ctxt;
mod fulfill;
mod opaques;
mod project_goals;
mod search_graph;
mod trait_goals;
@ -212,7 +213,7 @@ impl<'a, 'tcx> EvalCtxt<'a, 'tcx> {
);
}
match (lhs.to_projection_term(tcx), rhs.to_projection_term(tcx)) {
match (lhs.to_alias_ty(tcx), rhs.to_alias_ty(tcx)) {
(None, None) => bug!("`AliasRelate` goal without an alias on either lhs or rhs"),
// RHS is not a projection, only way this is true is if LHS normalizes-to RHS