diff --git a/src/rustc/middle/infer.rs b/src/rustc/middle/infer.rs index 147ea64a9c25..4f2cbf7abb61 100644 --- a/src/rustc/middle/infer.rs +++ b/src/rustc/middle/infer.rs @@ -978,6 +978,10 @@ iface combine { fn c_regions_scope_scope( a: ty::region, a_id: ast::node_id, b: ty::region, b_id: ast::node_id) -> cres; + fn c_regions_scope_free( + a: ty::region, a_id: ast::node_id, + b: ty::region, b_id: ast::node_id, b_br: ty::bound_region) + -> cres; fn c_regions_free_scope( a: ty::region, a_id: ast::node_id, a_br: ty::bound_region, b: ty::region, b_id: ast::node_id) -> cres; @@ -1327,9 +1331,12 @@ fn c_regions( {|x, y| self.c_regions(x, y) }) } - (f @ ty::re_free(f_id, f_br), s @ ty::re_scope(s_id)) | - (s @ ty::re_scope(s_id), f @ ty::re_free(f_id, f_br)) { - self.c_regions_free_scope(f, f_id, f_br, s, s_id) + (ty::re_free(a_id, a_br), ty::re_scope(b_id)) { + self.c_regions_free_scope(a, a_id, a_br, b, b_id) + } + + (ty::re_scope(a_id), ty::re_free(b_id, b_br)) { + self.c_regions_scope_free(b, b_id, b, b_id, b_br) } (ty::re_scope(a_id), ty::re_scope(b_id)) { @@ -1473,6 +1480,15 @@ impl of combine for lub { ret ok(a); // NDM--not so for nested functions } + fn c_regions_scope_free( + a: ty::region, a_id: ast::node_id, + b: ty::region, b_id: ast::node_id, b_br: ty::bound_region) + -> cres { + + // LUB is commutative: + self.c_regions_free_scope(b, b_id, b_br, a, a_id) + } + fn c_regions_scope_scope(a: ty::region, a_id: ast::node_id, b: ty::region, b_id: ast::node_id) -> cres { @@ -1614,6 +1630,15 @@ impl of combine for glb { ret ok(b); // NDM--not so for nested functions } + fn c_regions_scope_free( + a: ty::region, a_id: ast::node_id, + b: ty::region, b_id: ast::node_id, b_br: ty::bound_region) + -> cres { + + // GLB is commutative: + self.c_regions_free_scope(b, b_id, b_br, a, a_id) + } + fn c_regions_scope_scope(a: ty::region, a_id: ast::node_id, b: ty::region, b_id: ast::node_id) -> cres {