X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustc_typeck%2Fcheck%2Fop.rs;h=9b1a656b1bc98e48b1cfe495aa802099c3220d3d;hb=9a3e22e32f634014b02f13495aef3f0e8cdbb1b7;hp=7c871601af3088bc29672c15dfec74c865c40735;hpb=ebbecac538137fca1c36ceca91337b5ff4d196b5;p=rust.git diff --git a/src/librustc_typeck/check/op.rs b/src/librustc_typeck/check/op.rs index 7c871601af3..9b1a656b1bc 100644 --- a/src/librustc_typeck/check/op.rs +++ b/src/librustc_typeck/check/op.rs @@ -12,7 +12,7 @@ use rustc::hir; impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { - /// Check a `a = b` + /// Checks a `a = b` pub fn check_binop_assign(&self, expr: &'gcx hir::Expr, op: hir::BinOp, @@ -42,7 +42,7 @@ pub fn check_binop_assign(&self, ty } - /// Check a potentially overloaded binary operator. + /// Checks a potentially overloaded binary operator. pub fn check_binop(&self, expr: &'gcx hir::Expr, op: hir::BinOp, @@ -280,7 +280,7 @@ fn check_overloaded_binop(&self, rty, lstring, ); - err.span_suggestion_with_applicability( + err.span_suggestion( lhs_expr.span, msg, format!("*{}", lstring), @@ -434,7 +434,7 @@ fn check_str_addition( err.span_label(expr.span, "`+` can't be used to concatenate two `&str` strings"); match source_map.span_to_snippet(lhs_expr.span) { - Ok(lstring) => err.span_suggestion_with_applicability( + Ok(lstring) => err.span_suggestion( lhs_expr.span, msg, format!("{}.to_owned()", lstring), @@ -455,7 +455,7 @@ fn check_str_addition( is_assign, ) { (Ok(l), Ok(r), false) => { - err.multipart_suggestion_with_applicability( + err.multipart_suggestion( msg, vec![ (lhs_expr.span, format!("{}.to_owned()", l)), @@ -672,7 +672,7 @@ enum Op { Unary(hir::UnOp, Span), } -/// Returns true if this is a built-in arithmetic operation (e.g., u32 +/// Returns `true` if this is a built-in arithmetic operation (e.g., u32 /// + u32, i16x4 == i16x4) and false if these types would have to be /// overloaded to be legal. There are two reasons that we distinguish /// builtin operations from overloaded ones (vs trying to drive @@ -681,7 +681,7 @@ enum Op { /// /// 1. Builtin operations can trivially be evaluated in constants. /// 2. For comparison operators applied to SIMD types the result is -/// not of type `bool`. For example, `i16x4==i16x4` yields a +/// not of type `bool`. For example, `i16x4 == i16x4` yields a /// type like `i16x4`. This means that the overloaded trait /// `PartialEq` is not applicable. ///