Skip to content

Commit 5835a4c

Browse files
committed
Merge remote-tracking branch 'mozilla/master'
2 parents 8142438 + b0f6dad commit 5835a4c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

src/rustc/middle/ty.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1690,6 +1690,34 @@ mod unify {
16901690
ret nxt(mk_var(cx.tcx, key));
16911691
}
16921692

1693+
fn record_region_binding<T:copy>(
1694+
cx: @uctxt, key: uint,
1695+
r: region, base_mt: mt, variance: variance,
1696+
nxt: fn(t) -> ures<T>) -> ures<T> {
1697+
1698+
let rb = alt cx.st {
1699+
in_region_bindings(_, rb) { rb }
1700+
in_bindings(_) | precise { fail; }
1701+
};
1702+
1703+
ufind::grow(rb.sets, key + 1u);
1704+
let root = ufind::find(rb.sets, key);
1705+
let mut result_region = r;
1706+
alt smallintmap::find(rb.regions, root) {
1707+
some(old_region) {
1708+
alt unify_regions(cx, old_region, r, variance, {|v| ok(v)}) {
1709+
ok(unified_region) { result_region = unified_region; }
1710+
err(e) { ret err(e); }
1711+
}
1712+
}
1713+
none {/* fall through */ }
1714+
}
1715+
smallintmap::insert(rb.regions, root, result_region);
1716+
1717+
// FIXME: This should be re_var instead.
1718+
ret nxt(mk_rptr(cx.tcx, re_param(key), base_mt));
1719+
}
1720+
16931721
// Simple structural type comparison.
16941722
fn struct_cmp<T:copy>(
16951723
cx: @uctxt, expected: t, actual: t,

0 commit comments

Comments
 (0)