let a = infcx.inner.borrow_mut().type_variables().replace_if_possible(a);
let b = infcx.inner.borrow_mut().type_variables().replace_if_possible(b);
match (a.kind(), b.kind()) {
- (&ty::Infer(TyVar(a_vid)), &ty::Infer(TyVar(b_vid))) => {
+ (&ty::Infer(TyVar(_)), &ty::Infer(TyVar(_))) => {
// Shouldn't have any LBR here, so we can safely put
// this under a binder below without fear of accidental
// capture.
assert!(!b.has_escaping_bound_vars());
// can't make progress on `A <: B` if both A and B are
- // type variables, so record an obligation. We also
- // have to record in the `type_variables` tracker that
- // the two variables are equal modulo subtyping, which
- // is important to the occurs check later on.
- infcx.inner.borrow_mut().type_variables().sub(a_vid, b_vid);
+ // type variables, so record an obligation.
self.fields.obligations.push(Obligation::new(
self.fields.trace.cause.clone(),
self.fields.param_env,
// FIXME -- we have more fine-grained information available
// from the "cause" field, we could perhaps give more tailored
// error messages.
- let origin = SubregionOrigin::Subtype(box self.fields.trace.clone());
+ let origin = SubregionOrigin::Subtype(Box::new(self.fields.trace.clone()));
self.fields
.infcx
.inner