@@ -104,6 +104,7 @@ use middle::typeck::rscope::{RegionError};
104
104
use middle:: typeck:: rscope:: { in_binding_rscope, region_scope, type_rscope} ;
105
105
use middle:: typeck:: rscope;
106
106
use middle:: typeck:: { isr_alist, lookup_def_ccx, method_map_entry} ;
107
+ use middle:: typeck:: { method_map, vtable_map} ;
107
108
use middle:: typeck:: { method_origin, method_self, method_trait, no_params} ;
108
109
use middle:: typeck:: { require_same_types} ;
109
110
use util:: common:: { block_query, indenter, loop_query} ;
@@ -160,9 +161,13 @@ pub struct SelfInfo {
160
161
pub struct inherited {
161
162
infcx : @mut infer:: InferCtxt ,
162
163
locals : HashMap < ast:: node_id , ty:: t > ,
164
+
165
+ // Temporary tables:
163
166
node_types : HashMap < ast:: node_id , ty:: t > ,
164
167
node_type_substs : HashMap < ast:: node_id , ty:: substs > ,
165
- adjustments : HashMap < ast:: node_id , @ty:: AutoAdjustment >
168
+ adjustments : HashMap < ast:: node_id , @ty:: AutoAdjustment > ,
169
+ method_map : method_map ,
170
+ vtable_map : vtable_map ,
166
171
}
167
172
168
173
pub enum FnKind {
@@ -220,7 +225,9 @@ pub fn blank_inherited(ccx: @mut CrateCtxt) -> @inherited {
220
225
locals : HashMap ( ) ,
221
226
node_types : oldmap:: HashMap ( ) ,
222
227
node_type_substs : oldmap:: HashMap ( ) ,
223
- adjustments : oldmap:: HashMap ( )
228
+ adjustments : oldmap:: HashMap ( ) ,
229
+ method_map : oldmap:: HashMap ( ) ,
230
+ vtable_map : oldmap:: HashMap ( ) ,
224
231
}
225
232
}
226
233
@@ -1356,7 +1363,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
1356
1363
CheckTraitsAndInherentMethods ,
1357
1364
AutoderefReceiver ) {
1358
1365
Some ( ref entry) => {
1359
- let method_map = fcx. ccx . method_map ;
1366
+ let method_map = fcx. inh . method_map ;
1360
1367
method_map. insert ( expr. id , ( * entry) ) ;
1361
1368
}
1362
1369
None => {
@@ -1449,7 +1456,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
1449
1456
autoderef_receiver) {
1450
1457
Some ( ref origin) => {
1451
1458
let method_ty = fcx. node_ty ( op_ex. callee_id ) ;
1452
- let method_map = fcx. ccx . method_map ;
1459
+ let method_map = fcx. inh . method_map ;
1453
1460
method_map. insert ( op_ex. id , * origin) ;
1454
1461
Some ( check_call_inner ( fcx,
1455
1462
op_ex. span ,
@@ -1732,7 +1739,7 @@ pub fn check_expr_with_unifier(fcx: @mut FnCtxt,
1732
1739
CheckTraitsAndInherentMethods ,
1733
1740
AutoderefReceiver ) {
1734
1741
Some ( ref entry) => {
1735
- let method_map = fcx. ccx . method_map;
1742
+ let method_map = fcx. inh . method_map;
1736
1743
method_map. insert( expr. id, ( * entry) ) ;
1737
1744
1738
1745
// If we have resolved to a method but this is not in
0 commit comments