提交 106f783b 编写于 作者: P Patrick Walton

rustc: Add a fast path when the types to be unified are exactly equal

上级 9edaa7db
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册