@@ -1690,6 +1690,34 @@ mod unify {
1690
1690
ret nxt( mk_var ( cx. tcx , key) ) ;
1691
1691
}
1692
1692
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 + 1 u) ;
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
+
1693
1721
// Simple structural type comparison.
1694
1722
fn struct_cmp < T : copy > (
1695
1723
cx : @uctxt , expected : t , actual : t ,
0 commit comments