@@ -961,7 +961,8 @@ iface combine {
961
961
fn tag ( ) -> str ;
962
962
fn bnd < V : copy > ( b : bounds < V > ) -> option < V > ;
963
963
fn with_bnd < V : copy > ( b : bounds < V > , v : V ) -> bounds < V > ;
964
- fn c_bot ( b : ty:: t ) -> cres < ty:: t > ;
964
+ fn c_bot_ty ( b : ty:: t ) -> cres < ty:: t > ;
965
+ fn c_ty_bot ( b : ty:: t ) -> cres < ty:: t > ;
965
966
fn c_mts ( a : ty:: mt , b : ty:: mt ) -> cres < ty:: mt > ;
966
967
fn c_contratys ( t1 : ty:: t , t2 : ty:: t ) -> cres < ty:: t > ;
967
968
fn c_tys ( t1 : ty:: t , t2 : ty:: t ) -> cres < ty:: t > ;
@@ -974,7 +975,8 @@ iface combine {
974
975
a : ty:: region , b : ty:: region ) -> cres < ty:: region > ;
975
976
fn c_regions (
976
977
a : ty:: region , b : ty:: region ) -> cres < ty:: region > ;
977
- fn c_regions_static ( r : ty:: region ) -> cres < ty:: region > ;
978
+ fn c_regions_static_r ( r : ty:: region ) -> cres < ty:: region > ;
979
+ fn c_regions_r_static ( r : ty:: region ) -> cres < ty:: region > ;
978
980
fn c_regions_scope_scope (
979
981
a : ty:: region , a_id : ast:: node_id ,
980
982
b : ty:: region , b_id : ast:: node_id ) -> cres < ty:: region > ;
@@ -1171,8 +1173,8 @@ fn c_tys<C:combine>(
1171
1173
1172
1174
indent { ||
1173
1175
alt ( ty:: get ( a) . struct , ty:: get ( b) . struct ) {
1174
- ( ty:: ty_bot, _) { self . c_bot ( b) }
1175
- ( _, ty:: ty_bot) { self . c_bot ( b) }
1176
+ ( ty:: ty_bot, _) { self . c_ty_bot ( b) }
1177
+ ( _, ty:: ty_bot) { self . c_bot_ty ( b) }
1176
1178
1177
1179
( ty:: ty_var ( a_id) , ty:: ty_var ( b_id) ) {
1178
1180
c_vars ( self , self . infcx ( ) . vb ,
@@ -1314,8 +1316,12 @@ fn c_regions<C:combine>(
1314
1316
1315
1317
indent { ||
1316
1318
alt ( a, b) {
1317
- ( ty:: re_static, r) | ( r, ty:: re_static) {
1318
- self . c_regions_static ( r)
1319
+ ( ty:: re_static, r) {
1320
+ self . c_regions_static_r ( r)
1321
+ }
1322
+
1323
+ ( r, ty:: re_static) {
1324
+ self . c_regions_r_static ( r)
1319
1325
}
1320
1326
1321
1327
( ty:: re_var ( a_id) , ty:: re_var ( b_id) ) {
@@ -1386,10 +1392,14 @@ impl of combine for lub {
1386
1392
{ ub: some ( v) with b}
1387
1393
}
1388
1394
1389
- fn c_bot ( b : ty:: t ) -> cres < ty:: t > {
1395
+ fn c_bot_ty ( b : ty:: t ) -> cres < ty:: t > {
1390
1396
ok ( b)
1391
1397
}
1392
1398
1399
+ fn c_ty_bot ( b : ty:: t ) -> cres < ty:: t > {
1400
+ self . c_bot_ty ( b) // LUB is commutative
1401
+ }
1402
+
1393
1403
fn c_mts ( a : ty:: mt , b : ty:: mt ) -> cres < ty:: mt > {
1394
1404
let tcx = self . infcx ( ) . tcx ;
1395
1405
@@ -1465,12 +1475,15 @@ impl of combine for lub {
1465
1475
ret glb ( self . infcx ( ) ) . c_regions ( a, b) ;
1466
1476
}
1467
1477
1468
- fn c_regions_static ( _r : ty:: region ) -> cres < ty:: region > {
1469
- // LUB of `r` and static is always static---what's bigger than
1470
- // that?
1478
+ fn c_regions_static_r ( _r : ty:: region ) -> cres < ty:: region > {
1479
+ // nothing lives longer than static
1471
1480
ret ok( ty:: re_static) ;
1472
1481
}
1473
1482
1483
+ fn c_regions_r_static ( r : ty:: region ) -> cres < ty:: region > {
1484
+ self . c_regions_static_r ( r) // LUB is commutative
1485
+ }
1486
+
1474
1487
fn c_regions_free_scope (
1475
1488
a : ty:: region , _a_id : ast:: node_id , _a_br : ty:: bound_region ,
1476
1489
_b : ty:: region , _b_id : ast:: node_id ) -> cres < ty:: region > {
@@ -1517,10 +1530,14 @@ impl of combine for glb {
1517
1530
{ lb: some ( v) with b}
1518
1531
}
1519
1532
1520
- fn c_bot ( _b : ty:: t ) -> cres < ty:: t > {
1533
+ fn c_bot_ty ( _b : ty:: t ) -> cres < ty:: t > {
1521
1534
ok ( ty:: mk_bot ( self . infcx ( ) . tcx ) )
1522
1535
}
1523
1536
1537
+ fn c_ty_bot ( b : ty:: t ) -> cres < ty:: t > {
1538
+ self . c_bot_ty ( b) // GLB is commutative
1539
+ }
1540
+
1524
1541
fn c_mts ( a : ty:: mt , b : ty:: mt ) -> cres < ty:: mt > {
1525
1542
let tcx = self . infcx ( ) . tcx ;
1526
1543
@@ -1614,12 +1631,15 @@ impl of combine for glb {
1614
1631
ret lub ( self . infcx ( ) ) . c_regions ( a, b) ;
1615
1632
}
1616
1633
1617
- fn c_regions_static ( r : ty:: region ) -> cres < ty:: region > {
1618
- // GLB of `r` and static is always `r`; static is bigger than
1619
- // everything
1634
+ fn c_regions_static_r ( r : ty:: region ) -> cres < ty:: region > {
1635
+ // static lives longer than everything else
1620
1636
ret ok( r) ;
1621
1637
}
1622
1638
1639
+ fn c_regions_r_static ( r : ty:: region ) -> cres < ty:: region > {
1640
+ self . c_regions_static_r ( r) // GLB is commutative
1641
+ }
1642
+
1623
1643
fn c_regions_free_scope (
1624
1644
_a : ty:: region , _a_id : ast:: node_id , _a_br : ty:: bound_region ,
1625
1645
b : ty:: region , _b_id : ast:: node_id ) -> cres < ty:: region > {
0 commit comments