Try not to make obligations in handle_opaque_type

This commit is contained in:
Michael Goulet
2024-06-07 11:51:03 -04:00
parent 4efb13b0c2
commit e4be97cfe7
6 changed files with 74 additions and 91 deletions

View File

@@ -154,14 +154,7 @@ impl<'me, 'bccx, 'tcx> NllTypeRelating<'me, 'bccx, 'tcx> {
"expected at least one opaque type in `relate_opaques`, got {a} and {b}."
),
};
let cause = ObligationCause::dummy_with_span(self.span());
self.register_goals(
infcx
.handle_opaque_type(a, b, &cause, self.param_env())?
.obligations
.into_iter()
.map(Goal::from),
);
self.register_goals(infcx.handle_opaque_type(a, b, self.span(), self.param_env())?);
Ok(())
}