diff --git a/src/types.rs b/src/types.rs index 2c4d81e361d..2950a03a036 100644 --- a/src/types.rs +++ b/src/types.rs @@ -190,7 +190,7 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) { (false, true) => { span_lint(cx, CAST_POSSIBLE_OVERFLOW, expr.span, &format!("the contents of a {} may overflow a {}", cast_from, cast_to)); - if !cx.tcx.expr_ty(expr).is_signed() { + if !cast_to.is_signed() { span_lint(cx, CAST_SIGN_LOSS, expr.span, &format!("casting from {} to {} loses the sign of the value", cast_from, cast_to)); }