Get rid of StructurallyRelateAliases#158731
Conversation
|
changes to the core type system cc @lcnr |
|
The job Click to see the possible cause of the failure (guessed by this bot) |
| self.inner.borrow_mut().const_unification_table().union(a, b); | ||
| } | ||
|
|
||
| fn equate_ty_var_raw(&self, vid: ty::TyVid, ty: Ty<'tcx>) { |
There was a problem hiding this comment.
please name them instantiate instead of equate
| }) | ||
| } | ||
|
|
||
| /// Enforce that `a` is equal to `b`. |
There was a problem hiding this comment.
should comment
- how is it different from eq
- why does it exist
- where is it used
| } | ||
|
|
||
| (ty::Infer(ty::TyVar(a_vid)), _) => { | ||
| infcx.equate_ty_var_raw(a_vid, b); |
There was a problem hiding this comment.
can you add a debug_assert to instantiate_ty_var_raw tht the type we instantiate it with does not refer to anything from a higher universe?
There was a problem hiding this comment.
same for regions and consts :>
| let a = infcx.shallow_resolve_const(a); | ||
| let b = infcx.shallow_resolve_const(b); |
There was a problem hiding this comment.
we should be able to not do that but debug_assert that this is a noop?
| if let Some(a_inner) = a.no_bound_vars() | ||
| && let Some(b_inner) = b.no_bound_vars() |
There was a problem hiding this comment.
a and b have exactly the same bound vars here. we don't have to bother with the rebinding 🤔 actually, we can just recurse without instantiating bound vars at all
we can just assert that the bound vars are equal, and then recurse :>
Part of #155345
Finally we get rid of the last use of
StructurallyRelateAliases::Yes.r? lcnr