]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/op.rs
Remove need for &format!(...) or &&"" dances in `span_label` calls
[rust.git] / src / librustc_typeck / check / op.rs
index d3d65ce4a626e10f5d0ecc3faa7410b5883fdeae..59cb61d9b97f0b3196126eb3637a6daca34a0c29 100644 (file)
@@ -50,7 +50,7 @@ pub fn check_binop_assign(&self,
                 E0067, "invalid left-hand side expression")
             .span_label(
                 lhs_expr.span,
-                &format!("invalid expression for left-hand side"))
+                "invalid expression for left-hand side")
             .emit();
         }
         ty
@@ -203,7 +203,7 @@ fn check_overloaded_binop(&self,
                                          op.node.as_str(),
                                          lhs_ty)
                             .span_label(lhs_expr.span,
-                                        &format!("cannot use `{}=` on type `{}`",
+                                        format!("cannot use `{}=` on type `{}`",
                                         op.node.as_str(), lhs_ty))
                             .emit();
                     } else {
@@ -278,7 +278,7 @@ fn check_str_addition(&self,
             if let TyRef(_, r_ty) = rhs_ty.sty {
                 if l_ty.ty.sty == TyStr && r_ty.ty.sty == TyStr {
                     err.span_label(expr.span,
-                        &"`+` can't be used to concatenate two `&str` strings");
+                        "`+` can't be used to concatenate two `&str` strings");
                     let codemap = self.tcx.sess.codemap();
                     let suggestion =
                         match codemap.span_to_snippet(lhs_expr.span) {