]> git.lizzy.rs Git - rust.git/commitdiff
all: make style of lint messages consistent
authorGeorg Brandl <georg@python.org>
Wed, 12 Aug 2015 08:46:49 +0000 (10:46 +0200)
committerGeorg Brandl <georg@python.org>
Wed, 12 Aug 2015 08:47:09 +0000 (10:47 +0200)
* start first sentence lowercased
* use backticks to delimit code snippets
* use "this is wrong. Consider doing X." consistently

24 files changed:
src/approx_const.rs
src/attrs.rs
src/bit_mask.rs
src/collapsible_if.rs
src/eta_reduction.rs
src/identity_op.rs
src/len_zero.rs
src/misc.rs
src/mut_mut.rs
src/needless_bool.rs
src/ptr_arg.rs
src/returns.rs
src/strings.rs
src/types.rs
src/unicode.rs
tests/compile-fail/attrs.rs
tests/compile-fail/box_vec.rs
tests/compile-fail/collapsible_if.rs
tests/compile-fail/eta.rs [changed mode: 0644->0755]
tests/compile-fail/len_zero.rs
tests/compile-fail/match_if_let.rs
tests/compile-fail/modulo_one.rs [changed mode: 0644->0755]
tests/compile-fail/ptr_arg.rs
tests/compile-fail/unicode.rs

index 3ae579a74b9fdc264fa4a3e4762dfd1d8741788e..594348bf93faf52b4e24c67859ff9aae84696d91 100644 (file)
@@ -53,7 +53,7 @@ fn check_known_consts(cx: &Context, span: Span, str: &str, module: &str) {
         for &(constant, name) in KNOWN_CONSTS {
             if within_epsilon(constant, value) {
                 span_lint(cx, APPROX_CONSTANT, span, &format!(
-                    "Approximate value of {}::{} found, consider using it directly.", module, &name));
+                    "approximate value of `{}::{}` found. Consider using it directly.", module, &name));
             }
         }
     }
index 6d73f1de9649408f7c09dc92b1ad2ad98a58d500..789a992e3a5c937cd80ffd80c9a27b5b08675a86 100644 (file)
@@ -101,7 +101,7 @@ fn check_attrs(cx: &Context, info: Option<&ExpnInfo>, ident: &Ident,
             if let MetaWord(ref always) = values[0].node {
                 if always != &"always" { continue; }
                 span_lint(cx, INLINE_ALWAYS, attr.span, &format!(
-                    "You have declared #[inline(always)] on {}. This \
+                    "you have declared `#[inline(always)]` on `{}`. This \
                      is usually a bad idea. Are you sure?",
                     ident.name.as_str()));
             }
index ad6facfb199e9dbb76720ce97310c57df3a465dd..b5f088c23ef5e968341c61f2a269466c50eac4e5 100644 (file)
@@ -97,7 +97,7 @@ fn check_bit_mask(cx: &Context, bit_op: BinOp_, cmp_op: BinOp_,
             BiBitAnd => if mask_value & cmp_value != mask_value {
                 if cmp_value != 0 {
                     span_lint(cx, BAD_BIT_MASK, *span, &format!(
-                        "incompatible bit mask: _ & {} can never be equal to {}",
+                        "incompatible bit mask: `_ & {}` can never be equal to `{}`",
                         mask_value, cmp_value));
                 }
             } else {
@@ -108,7 +108,7 @@ fn check_bit_mask(cx: &Context, bit_op: BinOp_, cmp_op: BinOp_,
             },
             BiBitOr => if mask_value | cmp_value != cmp_value {
                 span_lint(cx, BAD_BIT_MASK, *span, &format!(
-                    "incompatible bit mask: _ | {} can never be equal to {}",
+                    "incompatible bit mask: `_ | {}` can never be equal to `{}`",
                     mask_value, cmp_value));
             },
             _ => ()
@@ -116,7 +116,7 @@ fn check_bit_mask(cx: &Context, bit_op: BinOp_, cmp_op: BinOp_,
         BiLt | BiGe => match bit_op {
             BiBitAnd => if mask_value < cmp_value {
                 span_lint(cx, BAD_BIT_MASK, *span, &format!(
-                    "incompatible bit mask: _ & {} will always be lower than {}",
+                    "incompatible bit mask: `_ & {}` will always be lower than `{}`",
                     mask_value, cmp_value));
             } else {
                 if mask_value == 0 {
@@ -126,12 +126,12 @@ fn check_bit_mask(cx: &Context, bit_op: BinOp_, cmp_op: BinOp_,
             },
             BiBitOr => if mask_value >= cmp_value {
                 span_lint(cx, BAD_BIT_MASK, *span, &format!(
-                    "incompatible bit mask: _ | {} will never be lower than {}",
+                    "incompatible bit mask: `_ | {}` will never be lower than `{}`",
                     mask_value, cmp_value));
             } else {
                 if mask_value < cmp_value {
                     span_lint(cx, INEFFECTIVE_BIT_MASK, *span, &format!(
-                        "ineffective bit mask: x | {} compared to {} is the same as x compared directly",
+                        "ineffective bit mask: `x | {}` compared to `{}` is the same as x compared directly",
                         mask_value, cmp_value));
                 }
             },
@@ -140,7 +140,7 @@ fn check_bit_mask(cx: &Context, bit_op: BinOp_, cmp_op: BinOp_,
         BiLe | BiGt => match bit_op {
             BiBitAnd => if mask_value <= cmp_value {
                 span_lint(cx, BAD_BIT_MASK, *span, &format!(
-                    "incompatible bit mask: _ & {} will never be higher than {}",
+                    "incompatible bit mask: `_ & {}` will never be higher than `{}`",
                     mask_value, cmp_value));
             } else {
                 if mask_value == 0 {
@@ -150,12 +150,12 @@ fn check_bit_mask(cx: &Context, bit_op: BinOp_, cmp_op: BinOp_,
             },
             BiBitOr => if mask_value > cmp_value {
                 span_lint(cx, BAD_BIT_MASK, *span, &format!(
-                    "incompatible bit mask: _ | {} will always be higher than {}",
+                    "incompatible bit mask: `_ | {}` will always be higher than `{}`",
                     mask_value, cmp_value));
             } else {
                 if mask_value < cmp_value {
                     span_lint(cx, INEFFECTIVE_BIT_MASK, *span, &format!(
-                        "ineffective bit mask: x | {} compared to {} is the same as x compared directly",
+                        "ineffective bit mask: `x | {}` compared to `{}` is the same as x compared directly",
                         mask_value, cmp_value));
                 }
             },
index eae3222945c2ba7eda32f415a6f13bf4dc90730e..f1c82f3eef8afa147ef193ea2f7dd583990445f9 100644 (file)
@@ -48,7 +48,7 @@ fn check_expr_expd(cx: &Context, e: &Expr, info: Option<&ExpnInfo>) {
         if let Some(&Expr{ node: ExprIf(ref check_inner, _, None), ..}) =
             single_stmt_of_block(then) {
                 span_lint(cx, COLLAPSIBLE_IF, e.span, &format!(
-                    "This if statement can be collapsed. Try: if {} && {}\n{:?}",
+                    "this if statement can be collapsed. Try: `if {} && {}`\n{:?}",
                     check_to_string(check), check_to_string(check_inner), e));
             }
     }
index 6948c1b22abb948b44e197c28281bb40e98dd9a2..00c5a5239819d88df574e2d64f93b61a02decdd7 100644 (file)
@@ -51,7 +51,7 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) {
                         }
                     }
                     span_lint(cx, REDUNDANT_CLOSURE, expr.span,
-                                 &format!("Redundant closure found, consider using `{}` in its place",
+                                 &format!("redundant closure found. Consider using `{}` in its place.",
                                           expr_to_string(caller))[..])
                 }
             }
index 56d01c52b1d836713392a25f4f2277b5eb1537ff..e043ac63026b71a9559b6bfac0a5dfe92044db20 100644 (file)
@@ -49,7 +49,7 @@ fn check_expr(&mut self, cx: &Context, e: &Expr) {
 fn check(cx: &Context, e: &Expr, m: i8, span: Span, arg: Span) {
     if have_lit(cx, e, m) {
         span_lint(cx, IDENTITY_OP, span, &format!(
-            "The operation is ineffective. Consider reducing it to '{}'",
+            "the operation is ineffective. Consider reducing it to `{}`.",
            snippet(cx, arg, "..")));
     }
 }
index 8aa4c6267607c05635db5095d68033163e6f6929..dea713180f50ee89b8d4ea7b29ac1b8b6a00e599 100644 (file)
@@ -58,8 +58,8 @@ fn is_named_self(item: &TraitItem, name: &str) -> bool {
         for i in trait_items {
             if is_named_self(i, "len") {
                 span_lint(cx, LEN_WITHOUT_IS_EMPTY, i.span,
-                          &format!("Trait '{}' has a '.len(_: &Self)' method, but no \
-                                    '.is_empty(_: &Self)' method. Consider adding one.",
+                          &format!("trait `{}` has a `.len(_: &Self)` method, but no \
+                                    `.is_empty(_: &Self)` method. Consider adding one.",
                                    item.ident.name));
             }
         };
@@ -78,8 +78,8 @@ fn is_named_self(item: &ImplItem, name: &str) -> bool {
                 let s = i.span;
                 span_lint(cx, LEN_WITHOUT_IS_EMPTY,
                           Span{ lo: s.lo, hi: s.lo, expn_id: s.expn_id },
-                          &format!("Item '{}' has a '.len(_: &Self)' method, but no \
-                                    '.is_empty(_: &Self)' method. Consider adding one.",
+                          &format!("item `{}` has a `.len(_: &Self)` method, but no \
+                                    `.is_empty(_: &Self)` method. Consider adding one.",
                                    item.ident.name));
                 return;
             }
@@ -108,7 +108,7 @@ fn check_len_zero(cx: &Context, span: Span, method: &SpannedIdent,
         if method.node.name == "len" && args.len() == 1 &&
             has_is_empty(cx, &*args[0]) {
                 span_lint(cx, LEN_ZERO, span, &format!(
-                    "Consider replacing the len comparison with '{}_.is_empty()'",
+                    "consider replacing the len comparison with `{}_.is_empty()`",
                     empty))
             }
     }
index 934e8a7fb77e14a982f1c773a84c842726719637..fa1847aad9a24d5b61a5a75cd5e168bb1660bc7b 100644 (file)
@@ -43,10 +43,10 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) {
                             format!("{{ {} }}", body_code)
                         };
                         span_help_and_lint(cx, SINGLE_MATCH, expr.span,
-                              "You seem to be trying to use match for \
+                              "you seem to be trying to use match for \
                               destructuring a single pattern. Did you mean to \
                               use `if let`?",
-                              &*format!("Try\nif let {} = {} {}",
+                              &*format!("try\nif let {} = {} {}",
                                         snippet(cx, arms[0].pats[0].span, ".."),
                                         snippet(cx, ex.span, ".."),
                                         suggestion)
@@ -74,7 +74,7 @@ fn check_expr(&mut self, cx: &Context, expr: &ast::Expr) {
             ast::ExprMethodCall(ref method, _, ref args)
                 if method.node.name == "to_string"
                 && is_str(cx, &*args[0]) => {
-                span_lint(cx, STR_TO_STRING, expr.span, "str.to_owned() is faster");
+                span_lint(cx, STR_TO_STRING, expr.span, "`str.to_owned()` is faster");
             },
             _ => ()
         }
@@ -105,7 +105,7 @@ fn check_fn(&mut self, cx: &Context, _: FnKind, decl: &FnDecl, _: &Block, _: Spa
                 span_lint(cx,
                     TOPLEVEL_REF_ARG,
                     arg.pat.span,
-                    "`ref` directly on a function argument is ignored. Have you considered using a reference type instead?"
+                    "`ref` directly on a function argument is ignored. Consider using a reference type instead."
                 );
             }
         }
@@ -139,7 +139,7 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) {
 fn check_nan(cx: &Context, path: &Path, span: Span) {
     path.segments.last().map(|seg| if seg.identifier.name == "NAN" {
         span_lint(cx, CMP_NAN, span,
-                  "Doomed comparison with NAN, use std::{f32,f64}::is_nan instead");
+                  "doomed comparison with NAN, use `std::{f32,f64}::is_nan()` instead");
     });
 }
 
@@ -159,7 +159,7 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) {
             let op = cmp.node;
             if (op == BiEq || op == BiNe) && (is_float(cx, left) || is_float(cx, right)) {
                 span_lint(cx, FLOAT_CMP, expr.span, &format!(
-                    "{}-Comparison of f32 or f64 detected. You may want to change this to 'abs({} - {}) < epsilon' for some suitable value of epsilon",
+                    "{}-comparison of f32 or f64 detected. Consider changing this to `abs({} - {}) < epsilon` for some suitable value of epsilon.",
                     binop_to_string(op), snippet(cx, left.span, ".."),
                     snippet(cx, right.span, "..")));
             }
@@ -190,7 +190,7 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) {
         if let ExprBinary(Spanned { node: op, ..}, ref left, ref right) = expr.node {
             if is_bit_op(op) && (is_arith_expr(left) || is_arith_expr(right)) {
                 span_lint(cx, PRECEDENCE, expr.span,
-                    "Operator precedence can trip the unwary. Consider adding parenthesis to the subexpression.");
+                    "operator precedence can trip the unwary. Consider adding parenthesis to the subexpression.");
             }
         }
     }
@@ -246,7 +246,7 @@ fn check_to_owned(cx: &Context, expr: &Expr, other_span: Span) {
                 name == "to_owned" && is_str_arg(cx, args) {
                     span_lint(cx, CMP_OWNED, expr.span, &format!(
                         "this creates an owned instance just for comparison. \
-                         Consider using {}.as_slice() to compare without allocation",
+                         Consider using `{}.as_slice()` to compare without allocation.",
                         snippet(cx, other_span, "..")))
                 }
         },
@@ -256,7 +256,7 @@ fn check_to_owned(cx: &Context, expr: &Expr, other_span: Span) {
                     match_path(path, &["String", "from"]) {
                         span_lint(cx, CMP_OWNED, expr.span, &format!(
                             "this creates an owned instance just for comparison. \
-                             Consider using {}.as_slice() to compare without allocation",
+                             Consider using `{}.as_slice()` to compare without allocation.",
                             snippet(cx, other_span, "..")))
                     }
             }
@@ -284,7 +284,7 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) {
         if let ExprBinary(ref cmp, _, ref right) = expr.node {
             if let &Spanned {node: BinOp_::BiRem, ..} = cmp {
                 if is_lit_one(right) {
-                    cx.span_lint(MODULO_ONE, expr.span, "Any number modulo 1 will be 0");
+                    cx.span_lint(MODULO_ONE, expr.span, "any number modulo 1 will be 0");
                 }
             }
         }
index 16ea422f77f8508d0089cd177ac5c2d44ae725cb..469a14a94520dc210263b8491164a268b36c77a4 100644 (file)
@@ -23,7 +23,7 @@ fn check_expr(&mut self, cx: &Context, expr: &Expr) {
 
     fn check_ty(&mut self, cx: &Context, ty: &Ty) {
         unwrap_mut(ty).and_then(unwrap_mut).map_or((), |_| span_lint(cx, MUT_MUT,
-            ty.span, "Generally you want to avoid &mut &mut _ if possible."))
+            ty.span, "generally you want to avoid `&mut &mut _` if possible"))
     }
 }
 
@@ -40,13 +40,13 @@ fn unwrap_addr(expr : &Expr) -> Option<&Expr> {
     unwrap_addr(expr).map_or((), |e| {
         unwrap_addr(e).map(|_| {
             span_lint(cx, MUT_MUT, expr.span,
-                      "Generally you want to avoid &mut &mut _ if possible.")
+                      "generally you want to avoid `&mut &mut _` if possible")
         }).unwrap_or_else(|| {
             if let TyRef(_, TypeAndMut{ty: _, mutbl: MutMutable}) =
                 cx.tcx.expr_ty(e).sty {
                     span_lint(cx, MUT_MUT, expr.span,
-                              "This expression mutably borrows a mutable reference. \
-                               Consider reborrowing")
+                              "this expression mutably borrows a mutable reference. \
+                               Consider reborrowing.")
                 }
         })
     })
index 3296bdeca8706eab5e508abdf92c8dcc19a65957..fcbc287e30fca14aebe80370152e23d43bc2f2e4 100644 (file)
@@ -34,10 +34,10 @@ fn check_expr(&mut self, cx: &Context, e: &Expr) {
                               "your if-then-else expression will always return true"); },
                 (Option::Some(true), Option::Some(false)) => {
                     span_lint(cx, NEEDLESS_BOOL, e.span,
-                              "you can reduce your if-statement to its predicate"); },
+                              "you can reduce your if statement to its predicate"); },
                 (Option::Some(false), Option::Some(true)) => {
                     span_lint(cx, NEEDLESS_BOOL, e.span,
-                              "you can reduce your if-statement to '!' + your predicate"); },
+                              "you can reduce your if statement to `!` + your predicate"); },
                 (Option::Some(false), Option::Some(false)) => {
                     span_lint(cx, NEEDLESS_BOOL, e.span,
                               "your if-then-else expression will always return false"); },
index 939277fe66cb876cb55e7c1eb59aa6c57bbeeb33..ed37c1120405ed23ba1d8a39746c475a8e0f8976 100644 (file)
@@ -60,10 +60,10 @@ fn check_ptr_subtype(cx: &Context, span: Span, ty: &Ty) {
     match_ty_unwrap(ty, &["Vec"]).map_or_else(|| match_ty_unwrap(ty,
         &["String"]).map_or((), |_| {
             span_lint(cx, PTR_ARG, span,
-                      "Writing '&String' instead of '&str' involves a new Object \
-                       where a slices will do. Consider changing the type to &str")
+                      "writing `&String` instead of `&str` involves a new object \
+                       where a slice will do. Consider changing the type to `&str`.")
         }), |_| span_lint(cx, PTR_ARG, span,
-                          "Writing '&Vec<_>' instead of \
-                           '&[_]' involves one more reference and cannot be used with \
-                           non-vec-based slices. Consider changing the type to &[...]"))
+                          "writing `&Vec<_>` instead of \
+                           `&[_]` involves one more reference and cannot be used with \
+                           non-Vec-based slices. Consider changing the type to `&[...]`."))
 }
index 5a361d3a7dc9596299927e2de582e1cc7406b55a..70af37d5181e21ac0dcc27811eb843d32de763ce 100644 (file)
@@ -59,7 +59,7 @@ fn check_final_expr(&mut self, cx: &Context, expr: &Expr) {
 
     fn emit_return_lint(&mut self, cx: &Context, spans: (Span, Span)) {
         span_lint(cx, NEEDLESS_RETURN, spans.0, &format!(
-            "unneeded return statement. Consider using {} \
+            "unneeded return statement. Consider using `{}` \
              without the trailing semicolon",
             snippet(cx, spans.1, "..")))
     }
index b6bc7654e4792453e8475f32c0cba7fe723f1b05..97016f362681e41d61491c4768475b7e3d4f66a3 100644 (file)
@@ -29,8 +29,8 @@ fn check_expr(&mut self, cx: &Context, e: &Expr) {
         if let &ExprAssign(ref target, ref  src) = &e.node {
             if is_string(cx, target) && is_add(src, target) {
                 span_lint(cx, STRING_ADD_ASSIGN, e.span,
-                    "You assign the result of adding something to this string. \
-                    Consider using `String::push_str(..) instead.")
+                    "you assign the result of adding something to this string. \
+                    Consider using `String::push_str()` instead.")
             }
         }
     }
index f6d7749f1600ef412fce2cc69947a9f27195164c..b03829660dcc85caf48cc91a35fc9c150281e7ed 100644 (file)
@@ -1,5 +1,3 @@
-
-
 use syntax::ptr::P;
 use syntax::ast;
 use syntax::ast::*;
@@ -55,8 +53,8 @@ fn check_ty(&mut self, cx: &Context, ty: &ast::Ty) {
           .and_then(|t| match_ty_unwrap(&**t, &["std", "vec", "Vec"]))
           .map(|_| {
             span_help_and_lint(cx, BOX_VEC, ty.span,
-                              "You seem to be trying to use Box<Vec<T>>. Did you mean to use Vec<T>?",
-                              "Vec<T> is already on the heap, Box<Vec<T>> makes an extra allocation");
+                              "you seem to be trying to use `Box<Vec<T>>`. Did you mean to use `Vec<T>`?",
+                              "`Vec<T>` is already on the heap, `Box<Vec<T>>` makes an extra allocation");
           });
         {
             // In case stuff gets moved around
@@ -71,7 +69,7 @@ fn check_ty(&mut self, cx: &Context, ty: &ast::Ty) {
             if match_ty_unwrap(ty, &path[..]).is_some() {
                 span_help_and_lint(cx, LINKEDLIST, ty.span,
                                    "I see you're using a LinkedList! Perhaps you meant some other data structure?",
-                                   "A RingBuf might work.");
+                                   "a RingBuf might work");
                 return;
             }
         }
index 1854d5be7ff203060087913d2db2e0794b220824..af48c9b99ad5232c44ba8c92c817b875eb0628e4 100644 (file)
@@ -41,6 +41,6 @@ fn lint_zero_width(cx: &Context, span: Span, start: Option<usize>) {
             lo: span.lo + BytePos(index as u32),
             hi: span.lo + BytePos(index as u32),
             expn_id: span.expn_id,
-        }, "Zero-width space detected. Consider using \\u{200B}")
+        }, "zero-width space detected. Consider using `\\u{200B}`.")
     });
 }
index 42bb0fca6dc90417c7d9bfe37d8af068ed5873a0..ca7a0d5c07b0f6a10737166472a8e0246857d58c 100755 (executable)
@@ -3,7 +3,7 @@
 
 #![deny(inline_always)]
 
-#[inline(always)] //~ERROR You have declared #[inline(always)] on test_attr_lint.
+#[inline(always)] //~ERROR you have declared `#[inline(always)]` on `test_attr_lint`.
 fn test_attr_lint() {
     assert!(true)
 }
index 7d80dd86d226cc72fef8ccb39d49edb6aadbf30e..58e780f190ce89c9b7dfe231d9f248f36dadee00 100755 (executable)
@@ -3,7 +3,7 @@
 #![plugin(clippy)]
 #![deny(clippy)]
 
-pub fn test(foo: Box<Vec<bool>>) { //~ ERROR You seem to be trying to use Box<Vec<T>>
+pub fn test(foo: Box<Vec<bool>>) { //~ ERROR you seem to be trying to use `Box<Vec<T>>`
     println!("{:?}", foo.get(0))
 }
 
index 280744b5b45c2d98919262cdb5f4b78d78cd6604..cc63e895f1c1f245179257c307abc12da3cabae6 100755 (executable)
@@ -5,13 +5,13 @@
 fn main() {
     let x = "hello";
     let y = "world";
-    if x == "hello" { //~ERROR This if statement can be collapsed
+    if x == "hello" { //~ERROR this if statement can be collapsed
         if y == "world" {
             println!("Hello world!");
         }
     }
 
-    if x == "hello" || x == "world" { //~ERROR This if statement can be collapsed
+    if x == "hello" || x == "world" { //~ERROR this if statement can be collapsed
         if y == "world" || y == "hello" {
             println!("Hello world!");
         }
old mode 100644 (file)
new mode 100755 (executable)
index 8ca88ee..9e48ec1
@@ -5,11 +5,11 @@
 
 fn main() {
     let a = |a, b| foo(a, b);
-    //~^ ERROR Redundant closure found, consider using `foo` in its place
+    //~^ ERROR redundant closure found. Consider using `foo` in its place
     let c = |a, b| {1+2; foo}(a, b);
-    //~^ ERROR Redundant closure found, consider using `{ 1 + 2; foo }` in its place
+    //~^ ERROR redundant closure found. Consider using `{ 1 + 2; foo }` in its place
     let d = |a, b| foo((|c, d| foo2(c,d))(a,b), b);
-    //~^ ERROR Redundant closure found, consider using `foo2` in its place
+    //~^ ERROR redundant closure found. Consider using `foo2` in its place
 }
 
 fn foo(_: u8, _: u8) {
@@ -18,4 +18,4 @@ fn foo(_: u8, _: u8) {
 
 fn foo2(_: u8, _: u8) -> u8 {
     1u8
-}
\ No newline at end of file
+}
index 48a10042658741ea8e2eebb1703a0429eb2412fa..3785a518e2b313b5ddf374593bfc55612666d470 100755 (executable)
@@ -5,14 +5,14 @@
 
 #[deny(len_without_is_empty)]
 impl One {
-    fn len(self: &Self) -> isize { //~ERROR Item 'One' has a '.len(_: &Self)'
+    fn len(self: &Self) -> isize { //~ERROR item `One` has a `.len(_: &Self)`
         1
     }
 }
 
 #[deny(len_without_is_empty)]
 trait TraitsToo {
-    fn len(self: &Self) -> isize; //~ERROR Trait 'TraitsToo' has a '.len(_:
+    fn len(self: &Self) -> isize; //~ERROR trait `TraitsToo` has a `.len(_:
 }
 
 impl TraitsToo for One {
@@ -56,7 +56,7 @@ fn is_empty(self: &Self) -> bool {
 
 #[deny(len_without_is_empty)]
 impl HasWrongIsEmpty {
-    fn len(self: &Self) -> isize { //~ERROR Item 'HasWrongIsEmpty' has a '.len(_: &Self)'
+    fn len(self: &Self) -> isize { //~ERROR item `HasWrongIsEmpty` has a `.len(_: &Self)`
         1
     }
 
@@ -69,7 +69,7 @@ fn is_empty(self: &Self, x : u32) -> bool {
 #[deny(len_zero)]
 fn main() {
     let x = [1, 2];
-    if x.len() == 0 { //~ERROR Consider replacing the len comparison
+    if x.len() == 0 { //~ERROR consider replacing the len comparison
         println!("This should not happen!");
     }
 
@@ -84,13 +84,13 @@ fn main() {
     }
 
     let hie = HasIsEmpty;
-    if hie.len() == 0 { //~ERROR Consider replacing the len comparison
+    if hie.len() == 0 { //~ERROR consider replacing the len comparison
         println!("Or this!");
     }
     assert!(!hie.is_empty());
 
     let wie : &WithIsEmpty = &Wither;
-    if wie.len() == 0 { //~ERROR Consider replacing the len comparison
+    if wie.len() == 0 { //~ERROR consider replacing the len comparison
         println!("Or this!");
     }
     assert!(!wie.is_empty());
index 47b8b18a5ecc03341212cc3d3a330457d38297dd..01bfe7447136e43984e83825be2fb6aabdfcba31 100755 (executable)
@@ -5,8 +5,8 @@
 
 fn main(){
     let x = Some(1u8);
-    match x {  //~ ERROR You seem to be trying to use match
-               //~^ HELP Try
+    match x {  //~ ERROR you seem to be trying to use match
+               //~^ HELP try
         Some(y) => {
             println!("{:?}", y);
         }
@@ -18,8 +18,8 @@ fn main(){
         None => ()
     }
     let z = (1u8,1u8);
-    match z { //~ ERROR You seem to be trying to use match
-              //~^ HELP Try
+    match z { //~ ERROR you seem to be trying to use match
+              //~^ HELP try
         (2...3, 7...9) => println!("{:?}", z),
         _ => {}
     }
old mode 100644 (file)
new mode 100755 (executable)
index 26c7de8..1301b4e
@@ -3,6 +3,6 @@
 #![deny(modulo_one)]
 
 fn main() {
-    10 % 1; //~ERROR Any number modulo 1 will be 0
+    10 % 1; //~ERROR any number modulo 1 will be 0
     10 % 2;
 }
index 7ba291b1439098d2ee7796f64e5bdb87127d3e9d..d56ea735a1d9d2a99f6261373b1aeed9115cad72 100755 (executable)
@@ -3,7 +3,7 @@
 
 #[deny(ptr_arg)]
 #[allow(unused)]
-fn do_vec(x: &Vec<i64>) { //~ERROR: Writing '&Vec<_>' instead of '&[_]'
+fn do_vec(x: &Vec<i64>) { //~ERROR: writing `&Vec<_>` instead of `&[_]`
     //Nothing here
 }
 
index a121b985f09f8b2a7fd407076e476ac0962db6c8..60edf2577e73c0c9198156a6f984e3967851567b 100755 (executable)
@@ -4,13 +4,13 @@
 #[deny(zero_width_space)]
 fn zero() {
     print!("Here >​< is a ZWS, and ​another");
-                            //~^ ERROR Zero-width space detected. Consider using \u{200B}
-                              //~^^ ERROR Zero-width space detected. Consider using \u{200B}
+                            //~^ ERROR zero-width space detected. Consider using `\u{200B}`
+                              //~^^ ERROR zero-width space detected. Consider using `\u{200B}`
 }
 
 //#[deny(unicode_canon)]
 fn canon() {
-    print!("̀ah?"); //not yet ~ERROR Non-canonical unicode sequence detected. Consider using à
+    print!("̀ah?"); //not yet ~ERROR non-canonical unicode sequence detected. Consider using à
 }
 
 //#[deny(ascii_only)]