auto merge of #20443 : nikomatsakis/rust/autoderef-overloaded-calls, r=pcwalton

Use autoderef for call notation. This is consistent in that we now autoderef all postfix operators (`.`, `[]`, and `()`). It also means you can call closures without writing `(*f)()`. Note that this is rebased atop the rollup, so only the final commit is relevant.

r? @pcwalton
This commit is contained in:
bors 2015-01-04 16:36:41 +00:00
commit 260e46115b
9 changed files with 268 additions and 135 deletions

View file

@ -509,7 +509,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
let method_call = ty::MethodCall::expr(call_expr.id);
let return_ty = ty::ty_fn_ret(match self.tcx.method_map.borrow().get(&method_call) {
Some(method) => method.ty,
None => ty::expr_ty(self.tcx, func_or_rcvr)
None => ty::expr_ty_adjusted(self.tcx, func_or_rcvr)
});
let func_or_rcvr_exit = self.expr(func_or_rcvr, pred);