@@ -1027,7 +1027,7 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext,
1027
1027
} )
1028
1028
}
1029
1029
1030
- if let Some ( item_substs) = tcx. item_substs . borrow ( ) . get ( & id) {
1030
+ if let Some ( item_substs) = tcx. tables . borrow ( ) . item_substs . get ( & id) {
1031
1031
rbml_w. tag ( c:: tag_table_item_subst, |rbml_w| {
1032
1032
rbml_w. id ( id) ;
1033
1033
rbml_w. emit_substs ( ecx, & item_substs. substs ) ;
@@ -1051,7 +1051,12 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext,
1051
1051
var_id : var_id,
1052
1052
closure_expr_id : id
1053
1053
} ;
1054
- let upvar_capture = tcx. upvar_capture_map . borrow ( ) . get ( & upvar_id) . unwrap ( ) . clone ( ) ;
1054
+ let upvar_capture = tcx. tables
1055
+ . borrow ( )
1056
+ . upvar_capture_map
1057
+ . get ( & upvar_id)
1058
+ . unwrap ( )
1059
+ . clone ( ) ;
1055
1060
var_id. encode ( rbml_w) ;
1056
1061
upvar_capture. encode ( rbml_w) ;
1057
1062
} )
@@ -1074,19 +1079,19 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext,
1074
1079
}
1075
1080
1076
1081
let method_call = MethodCall :: expr ( id) ;
1077
- if let Some ( method) = tcx. method_map . borrow ( ) . get ( & method_call) {
1082
+ if let Some ( method) = tcx. tables . borrow ( ) . method_map . get ( & method_call) {
1078
1083
rbml_w. tag ( c:: tag_table_method_map, |rbml_w| {
1079
1084
rbml_w. id ( id) ;
1080
1085
encode_method_callee ( ecx, rbml_w, method_call. autoderef , method)
1081
1086
} )
1082
1087
}
1083
1088
1084
- if let Some ( adjustment) = tcx. adjustments . borrow ( ) . get ( & id) {
1089
+ if let Some ( adjustment) = tcx. tables . borrow ( ) . adjustments . get ( & id) {
1085
1090
match * adjustment {
1086
1091
ty:: AdjustDerefRef ( ref adj) => {
1087
1092
for autoderef in 0 ..adj. autoderefs {
1088
1093
let method_call = MethodCall :: autoderef ( id, autoderef as u32 ) ;
1089
- if let Some ( method) = tcx. method_map . borrow ( ) . get ( & method_call) {
1094
+ if let Some ( method) = tcx. tables . borrow ( ) . method_map . get ( & method_call) {
1090
1095
rbml_w. tag ( c:: tag_table_method_map, |rbml_w| {
1091
1096
rbml_w. id ( id) ;
1092
1097
encode_method_callee ( ecx, rbml_w,
@@ -1104,14 +1109,14 @@ fn encode_side_tables_for_id(ecx: &e::EncodeContext,
1104
1109
} )
1105
1110
}
1106
1111
1107
- if let Some ( closure_type) = tcx. closure_tys . borrow ( ) . get ( & ast_util:: local_def ( id) ) {
1112
+ if let Some ( closure_type) = tcx. tables . borrow ( ) . closure_tys . get ( & ast_util:: local_def ( id) ) {
1108
1113
rbml_w. tag ( c:: tag_table_closure_tys, |rbml_w| {
1109
1114
rbml_w. id ( id) ;
1110
1115
rbml_w. emit_closure_type ( ecx, closure_type) ;
1111
1116
} )
1112
1117
}
1113
1118
1114
- if let Some ( closure_kind) = tcx. closure_kinds . borrow ( ) . get ( & ast_util:: local_def ( id) ) {
1119
+ if let Some ( closure_kind) = tcx. tables . borrow ( ) . closure_kinds . get ( & ast_util:: local_def ( id) ) {
1115
1120
rbml_w. tag ( c:: tag_table_closure_kinds, |rbml_w| {
1116
1121
rbml_w. id ( id) ;
1117
1122
encode_closure_kind ( rbml_w, * closure_kind)
@@ -1630,7 +1635,7 @@ fn decode_side_tables(dcx: &DecodeContext,
1630
1635
let item_substs = ty:: ItemSubsts {
1631
1636
substs : val_dsr. read_substs ( dcx)
1632
1637
} ;
1633
- dcx. tcx . item_substs . borrow_mut ( ) . insert (
1638
+ dcx. tcx . tables . borrow_mut ( ) . item_substs . insert (
1634
1639
id, item_substs) ;
1635
1640
}
1636
1641
c:: tag_table_freevars => {
@@ -1646,7 +1651,7 @@ fn decode_side_tables(dcx: &DecodeContext,
1646
1651
closure_expr_id : id
1647
1652
} ;
1648
1653
let ub: ty:: UpvarCapture = Decodable :: decode ( val_dsr) . unwrap ( ) ;
1649
- dcx. tcx . upvar_capture_map . borrow_mut ( ) . insert ( upvar_id, ub. tr ( dcx) ) ;
1654
+ dcx. tcx . tables . borrow_mut ( ) . upvar_capture_map . insert ( upvar_id, ub. tr ( dcx) ) ;
1650
1655
}
1651
1656
c:: tag_table_tcache => {
1652
1657
let type_scheme = val_dsr. read_type_scheme ( dcx) ;
@@ -1663,22 +1668,22 @@ fn decode_side_tables(dcx: &DecodeContext,
1663
1668
expr_id : id,
1664
1669
autoderef : autoderef
1665
1670
} ;
1666
- dcx. tcx . method_map . borrow_mut ( ) . insert ( method_call, method) ;
1671
+ dcx. tcx . tables . borrow_mut ( ) . method_map . insert ( method_call, method) ;
1667
1672
}
1668
1673
c:: tag_table_adjustments => {
1669
1674
let adj: ty:: AutoAdjustment = val_dsr. read_auto_adjustment ( dcx) ;
1670
- dcx. tcx . adjustments . borrow_mut ( ) . insert ( id, adj) ;
1675
+ dcx. tcx . tables . borrow_mut ( ) . adjustments . insert ( id, adj) ;
1671
1676
}
1672
1677
c:: tag_table_closure_tys => {
1673
1678
let closure_ty =
1674
1679
val_dsr. read_closure_ty ( dcx) ;
1675
- dcx. tcx . closure_tys . borrow_mut ( ) . insert ( ast_util:: local_def ( id) ,
1680
+ dcx. tcx . tables . borrow_mut ( ) . closure_tys . insert ( ast_util:: local_def ( id) ,
1676
1681
closure_ty) ;
1677
1682
}
1678
1683
c:: tag_table_closure_kinds => {
1679
1684
let closure_kind =
1680
1685
val_dsr. read_closure_kind ( dcx) ;
1681
- dcx. tcx . closure_kinds . borrow_mut ( ) . insert ( ast_util:: local_def ( id) ,
1686
+ dcx. tcx . tables . borrow_mut ( ) . closure_kinds . insert ( ast_util:: local_def ( id) ,
1682
1687
closure_kind) ;
1683
1688
}
1684
1689
c:: tag_table_cast_kinds => {
0 commit comments