@@ -367,8 +367,7 @@ fn apply_adjustments<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
367367 match datum. ty . sty {
368368 // Don't skip a conversion from Box<T> to &T, etc.
369369 ty:: TyRef ( ..) => {
370- let method_call = MethodCall :: autoderef ( expr. id , 0 ) ;
371- if bcx. tcx ( ) . tables . borrow ( ) . method_map . contains_key ( & method_call) {
370+ if bcx. tcx ( ) . is_overloaded_autoderef ( expr. id , 0 ) {
372371 // Don't skip an overloaded deref.
373372 0
374373 } else {
@@ -1612,9 +1611,7 @@ fn trans_unary<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
16121611 // The only overloaded operator that is translated to a datum
16131612 // is an overloaded deref, since it is always yields a `&T`.
16141613 // Otherwise, we should be in the RvalueDpsExpr path.
1615- assert ! (
1616- op == ast:: UnDeref ||
1617- !ccx. tcx( ) . tables. borrow( ) . method_map. contains_key( & method_call) ) ;
1614+ assert ! ( op == ast:: UnDeref || !ccx. tcx( ) . is_method_call( expr. id) ) ;
16181615
16191616 let un_ty = expr_ty ( bcx, expr) ;
16201617
@@ -1907,7 +1904,7 @@ fn trans_binary<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
19071904 let ccx = bcx. ccx ( ) ;
19081905
19091906 // if overloaded, would be RvalueDpsExpr
1910- assert ! ( !ccx. tcx( ) . tables . borrow ( ) . method_map . contains_key ( & MethodCall :: expr( expr . id) ) ) ;
1907+ assert ! ( !ccx. tcx( ) . is_method_call ( expr. id) ) ;
19111908
19121909 match op. node {
19131910 ast:: BiAnd => {
@@ -2141,7 +2138,7 @@ fn trans_assign_op<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
21412138 debug ! ( "trans_assign_op(expr={:?})" , expr) ;
21422139
21432140 // User-defined operator methods cannot be used with `+=` etc right now
2144- assert ! ( !bcx. tcx( ) . tables . borrow ( ) . method_map . contains_key ( & MethodCall :: expr( expr . id) ) ) ;
2141+ assert ! ( !bcx. tcx( ) . is_method_call ( expr. id) ) ;
21452142
21462143 // Evaluate LHS (destination), which should be an lvalue
21472144 let dst_datum = unpack_datum ! ( bcx, trans_to_lvalue( bcx, dst, "assign_op" ) ) ;
@@ -2606,7 +2603,7 @@ enum ExprKind {
26062603}
26072604
26082605fn expr_kind ( tcx : & ty:: ctxt , expr : & ast:: Expr ) -> ExprKind {
2609- if tcx. tables . borrow ( ) . method_map . contains_key ( & MethodCall :: expr ( expr . id ) ) {
2606+ if tcx. is_method_call ( expr. id ) {
26102607 // Overloaded operations are generally calls, and hence they are
26112608 // generated via DPS, but there are a few exceptions:
26122609 return match expr. node {
0 commit comments