diff --git a/src/comp/middle/ty.rs b/src/comp/middle/ty.rs index 96479c4096d68dc6bdc758186b98aa17a2a57002..d57b8071b06af76f2b38cdbb3ba812f011557952 100644 --- a/src/comp/middle/ty.rs +++ b/src/comp/middle/ty.rs @@ -1877,6 +1877,9 @@ fn unify_step(@ctxt cx, @ty.t expected, @ty.t actual) -> result { // 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.