rustc: Use the rhs span when unifying binops

This makes the error message correctly identify the term that wasn't the
expected type. Issue #516.
This commit is contained in:
Brian Anderson 2011-06-22 20:50:53 -07:00
parent ae234d61ea
commit 523a088451

View File

@ -1467,7 +1467,7 @@ fn check_expr(&@fn_ctxt fcx, &@ast::expr expr) {
auto lhs_t = expr_ty(fcx.ccx.tcx, lhs);
auto rhs_t = expr_ty(fcx.ccx.tcx, rhs);
demand::autoderef(fcx, expr.span, lhs_t, rhs_t, AUTODEREF_OK);
demand::autoderef(fcx, rhs.span, lhs_t, rhs_t, AUTODEREF_OK);
// FIXME: Binops have a bit more subtlety than this.