dir: RelationDir)
-> RelateResult<'tcx, Generalization<'tcx>>
{
+ debug!("generalize(ty={:?}, for_vid={:?}, dir={:?}", ty, for_vid, dir);
// Determine the ambient variance within which `ty` appears.
// The surrounding equation is:
//
root_ty: ty,
};
- let ty = generalize.relate(&ty, &ty)?;
+ let ty = match generalize.relate(&ty, &ty) {
+ Ok(ty) => ty,
+ Err(e) => {
+ debug!("generalize: failure {:?}", e);
+ return Err(e);
+ }
+ };
let needs_wf = generalize.needs_wf;
+ debug!("generalize: success {{ {:?}, {:?} }}", ty, needs_wf);
Ok(Generalization { ty, needs_wf })
}
}
if self.ambient_variance == ty::Variance::Invariant {
// Avoid fetching the variance if we are in an invariant
// context; no need, and it can induce dependency cycles
- // (e.g. #41849).
+ // (e.g., #41849).
relate::relate_substs(self, None, a_subst, b_subst)
} else {
let opt_variances = self.tcx().variances_of(item_def_id);
}
}
- ty::ReCanonical(..) |
ty::ReClosureBound(..) => {
span_bug!(
self.span,