1
Fork 0

Adjust self-type to require equality

This commit is contained in:
Mark Rousskov 2021-05-20 10:15:56 -04:00
parent 35bab923c8
commit 4b4382d88b
6 changed files with 34 additions and 20 deletions

View file

@ -1522,7 +1522,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let ty = tcx.type_of(impl_def_id);
let impl_ty = self.instantiate_type_scheme(span, &substs, ty);
match self.at(&self.misc(span), self.param_env).sup(impl_ty, self_ty) {
match self.at(&self.misc(span), self.param_env).eq(impl_ty, self_ty) {
Ok(ok) => self.register_infer_ok_obligations(ok),
Err(_) => {
self.tcx.sess.delay_span_bug(