]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/hir/check_attr.rs
Remove need for &format!(...) or &&"" dances in `span_label` calls
[rust.git] / src / librustc / hir / check_attr.rs
index bf292ccb8d86d064212c1d33c40e56b90c0c144a..f553c03d09bd680e683243f3bc57a1171640dd22 100644 (file)
@@ -43,7 +43,7 @@ impl<'a> CheckAttrVisitor<'a> {
     fn check_inline(&self, attr: &ast::Attribute, target: Target) {
         if target != Target::Fn {
             struct_span_err!(self.sess, attr.span, E0518, "attribute should be applied to function")
-                .span_label(attr.span, &format!("requires a function"))
+                .span_label(attr.span, "requires a function")
                 .emit();
         }
     }
@@ -123,7 +123,7 @@ fn check_repr(&self, attr: &ast::Attribute, target: Target) {
                 _ => continue,
             };
             struct_span_err!(self.sess, attr.span, E0517, "{}", message)
-                .span_label(attr.span, &format!("requires {}", label))
+                .span_label(attr.span, format!("requires {}", label))
                 .emit();
         }
         if conflicting_reprs > 1 {