Skip to content

Commit

Permalink
rustc: Use the rhs span when unifying binops
Browse files Browse the repository at this point in the history
This makes the error message correctly identify the term that wasn't the
expected type. Issue #516.
  • Loading branch information
brson committed Jun 23, 2011
1 parent ae234d6 commit 523a088
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/comp/middle/typeck.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 523a088

Please sign in to comment.