rustc: Add a fast path when the types to be unified are exactly equal
This commit is contained in:
parent
9edaa7dba3
commit
106f783b33
1 changed files with 3 additions and 0 deletions
|
@ -1877,6 +1877,9 @@ mod Unify {
|
|||
// TODO: occurs check, to make sure we don't loop forever when
|
||||
// unifying e.g. 'a and option['a]
|
||||
|
||||
// Fast path.
|
||||
if (eq_ty(expected, actual)) { ret ures_ok(expected); }
|
||||
|
||||
alt (actual.struct) {
|
||||
// If the RHS is a variable type, then just do the appropriate
|
||||
// binding.
|
||||
|
|
Loading…
Add table
Reference in a new issue