}
fn mark_ambiguous(&mut self) {
- // The generalizer always compares types against themselves,
- // and thus doesn't really take part in coherence.
+ span_bug!(self.cause.span, "opaque types are handled in `tys`");
}
fn binders<T>(
// relatable.
Ok(t)
}
+ ty::Opaque(def_id, substs) => {
+ let s = self.relate(substs, substs)?;
+ Ok(if s == substs { t } else { self.infcx.tcx.mk_opaque(def_id, s) })
+ }
_ => relate::super_relate_tys(self, t, t),
}?;
origin: var_value.origin,
val: ConstVariableValue::Unknown { universe: self.for_universe },
});
- Ok(self.tcx().mk_const_var(new_var_id, c.ty()))
+ Ok(self.tcx().mk_const(new_var_id, c.ty()))
}
}
}
substs,
substs,
)?;
- Ok(self.tcx().mk_const(
- ty::ConstKind::Unevaluated(ty::UnevaluatedConst { def, substs }),
- c.ty(),
- ))
+ Ok(self.tcx().mk_const(ty::UnevaluatedConst { def, substs }, c.ty()))
}
_ => relate::super_relate_consts(self, c, c),
}
}
fn intercrate(&self) -> bool {
- self.infcx.intercrate
+ assert!(!self.infcx.intercrate);
+ false
}
fn param_env(&self) -> ty::ParamEnv<'tcx> {
},
},
);
- Ok(self.tcx().mk_const_var(new_var_id, c.ty()))
+ Ok(self.tcx().mk_const(new_var_id, c.ty()))
}
}
}
substs,
)?;
- Ok(self.tcx().mk_const(
- ty::ConstKind::Unevaluated(ty::UnevaluatedConst { def, substs }),
- c.ty(),
- ))
+ Ok(self.tcx().mk_const(ty::UnevaluatedConst { def, substs }, c.ty()))
}
_ => relate::super_relate_consts(self, c, c),
}