Skip to content

Commit 385683d

Browse files
committed
---
yaml --- r: 2197 b: refs/heads/master c: 9edaa7d h: refs/heads/master i: 2195: a326e0c v: v3
1 parent 4a2de3b commit 385683d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 9ab9bd9cc2dc97c2acc26849dd24b8989b76ea32
2+
refs/heads/master: 9edaa7dba3181ae68c60204e1e47a2d20e86236e

trunk/src/comp/middle/ty.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2362,9 +2362,15 @@ mod Unify {
23622362

23632363
auto ures = unify_step(cx, expected, actual);
23642364
alt (ures) {
2365-
case (ures_ok(?t)) {
2365+
case (ures_ok(?typ)) {
2366+
// Fast path: if there are no local variables, don't perform
2367+
// substitutions.
2368+
if (_vec.len[mutable UFind.node](cx.sets.nodes) == 0u) {
2369+
ret ures_ok(typ);
2370+
}
2371+
23662372
auto set_types = unify_sets(cx);
2367-
auto t2 = substitute(cx, set_types, t);
2373+
auto t2 = substitute(cx, set_types, typ);
23682374
ret ures_ok(t2);
23692375
}
23702376
case (_) { ret ures; }

0 commit comments

Comments
 (0)