mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
remove unnecessary clause propagating divergence
This should not be needed: the new variable will be related to the old ones, so if they are constrained, so is the new variable; if they are not, and hence default to diverging, so will the new variable.
This commit is contained in:
parent
69fe43c97e
commit
44d992984a
@ -70,14 +70,6 @@ pub fn super_lattice_tys<'a, 'gcx, 'tcx, L>(this: &mut L,
|
||||
let a = infcx.type_variables.borrow_mut().replace_if_possible(a);
|
||||
let b = infcx.type_variables.borrow_mut().replace_if_possible(b);
|
||||
match (&a.sty, &b.sty) {
|
||||
(&ty::TyInfer(TyVar(..)), &ty::TyInfer(TyVar(..)))
|
||||
if infcx.type_var_diverges(a) && infcx.type_var_diverges(b) => {
|
||||
let v = infcx.next_diverging_ty_var(
|
||||
TypeVariableOrigin::LatticeVariable(this.cause().span));
|
||||
this.relate_bound(v, a, b)?;
|
||||
Ok(v)
|
||||
}
|
||||
|
||||
// If one side is known to be a variable and one is not,
|
||||
// create a variable (`v`) to represent the LUB. Make sure to
|
||||
// relate `v` to the non-type-variable first (by passing it
|
||||
|
Loading…
Reference in New Issue
Block a user