]> git.lizzy.rs Git - rust.git/commitdiff
Remove redundancy in lint documentation
authormcarton <cartonmartin+git@gmail.com>
Fri, 5 Feb 2016 23:41:54 +0000 (00:41 +0100)
committermcarton <cartonmartin+git@gmail.com>
Fri, 5 Feb 2016 23:41:54 +0000 (00:41 +0100)
The default level is always given in the declare_lint! macro, no need to
add it inconsistently in the documentation.

44 files changed:
src/approx_const.rs
src/attrs.rs
src/bit_mask.rs
src/block_in_if_condition.rs
src/collapsible_if.rs
src/cyclomatic_complexity.rs
src/drop_ref.rs
src/eq_op.rs
src/escape.rs
src/eta_reduction.rs
src/identity_op.rs
src/items_after_statements.rs
src/len_zero.rs
src/lifetimes.rs
src/loops.rs
src/map_clone.rs
src/matches.rs
src/methods.rs
src/minmax.rs
src/misc.rs
src/misc_early.rs
src/mut_mut.rs
src/mut_reference.rs
src/mutex_atomic.rs
src/needless_bool.rs
src/needless_features.rs
src/needless_update.rs
src/no_effect.rs
src/open_options.rs
src/panic.rs
src/precedence.rs
src/print.rs
src/ptr_arg.rs
src/ranges.rs
src/regex.rs
src/returns.rs
src/shadow.rs
src/strings.rs
src/temporary_assignment.rs
src/transmute.rs
src/types.rs
src/unicode.rs
src/vec.rs
src/zero_div_zero.rs

index 2c8779ae7376137c09cd3a38d6a6743f7ca190e4..98e2fa97eba728d884967d63880ffddd07b288d4 100644 (file)
@@ -6,7 +6,7 @@
 use syntax::ast::Lit;
 use syntax::ast::FloatTy::*;
 
-/// **What it does:** This lint checks for floating point literals that approximate constants which are defined in [`std::f32::consts`](https://doc.rust-lang.org/stable/std/f32/consts/#constants) or [`std::f64::consts`](https://doc.rust-lang.org/stable/std/f64/consts/#constants), respectively, suggesting to use the predefined constant. This lint is `Warn` by default.
+/// **What it does:** This lint checks for floating point literals that approximate constants which are defined in [`std::f32::consts`](https://doc.rust-lang.org/stable/std/f32/consts/#constants) or [`std::f64::consts`](https://doc.rust-lang.org/stable/std/f64/consts/#constants), respectively, suggesting to use the predefined constant.
 ///
 /// **Why is this bad?** Usually, the definition in the standard library is more precise than what people come up with. If you find that your definition is actually more precise, please [file a Rust issue](https://github.com/rust-lang/rust/issues).
 ///
index f224b7dff29c6adb97a8f061e546c821b632715e..231a08779cc1ac76521666970f6d21eb2bdc50bc 100644 (file)
@@ -9,7 +9,7 @@
 use syntax::ast::{Attribute, Lit, Lit_, MetaList, MetaWord, MetaNameValue};
 use utils::{in_macro, match_path, span_lint, BEGIN_UNWIND};
 
-/// **What it does:** This lint `Warn`s on items annotated with `#[inline(always)]`, unless the annotated function is empty or simply panics.
+/// **What it does:** This lint checks for items annotated with `#[inline(always)]`, unless the annotated function is empty or simply panics.
 ///
 /// **Why is this bad?** While there are valid uses of this annotation (and once you know when to use it, by all means `allow` this lint), it's a common newbie-mistake to pepper one's code with it.
 ///
@@ -27,7 +27,7 @@
     "`#[inline(always)]` is a bad idea in most cases"
 }
 
-/// **What it does:** This lint `Warn`s on `#[deprecated]` annotations with a `since` field that is not a valid semantic version..
+/// **What it does:** This lint checks for `#[deprecated]` annotations with a `since` field that is not a valid semantic version..
 ///
 /// **Why is this bad?** For checking the version of the deprecation, it must be valid semver. Failing that, the contained information is useless.
 ///
index 0fce772010a9a1796978037425ff10c4a12e8304..b9925f10fa21a3b55c36ddf86e5f8b82b3bc3e0e 100644 (file)
@@ -8,7 +8,7 @@
 
 use utils::span_lint;
 
-/// **What it does:** This lint checks for incompatible bit masks in comparisons. It is `Warn` by default.
+/// **What it does:** This lint checks for incompatible bit masks in comparisons.
 ///
 /// The formula for detecting if an expression of the type  `_ <bit_op> m <cmp_op> c` (where `<bit_op>`
 /// is one of {`&`, `|`} and `<cmp_op>` is one of {`!=`, `>=`, `>`, `!=`, `>=`, `>`}) can be determined from the following table:
@@ -43,8 +43,6 @@
 /// |`>` / `<=`|`|` / `^`|`x | 2 > 3`|`x > 3`|
 /// |`<` / `>=`|`|` / `^`|`x ^ 1 < 4`|`x < 4`|
 ///
-/// This lint is `Warn` by default.
-///
 /// **Why is this bad?** Not equally evil as [`bad_bit_mask`](#bad_bit_mask), but still a bit misleading, because the bit mask is ineffective.
 ///
 /// **Known problems:** False negatives: This lint will only match instances where we have figured out the math (which is for a power-of-two compared value). This means things like `x | 1 >= 7` (which would be better written as `x >= 6`) will not be reported (but bit masks like this are fairly uncommon).
index 0162ef92dd6fc436c5e9cfb5a7ff9cc53b07aebf..65fbce640cfda035035e9f9e61df4943e54142dc 100644 (file)
@@ -3,7 +3,7 @@
 use rustc_front::intravisit::{Visitor, walk_expr};
 use utils::*;
 
-/// **What it does:** This lint checks for `if` conditions that use blocks to contain an expression. It is `Warn` by default.
+/// **What it does:** This lint checks for `if` conditions that use blocks to contain an expression.
 ///
 /// **Why is this bad?** It isn't really rust style, same as using parentheses to contain expressions.
 ///
@@ -15,7 +15,7 @@
     "braces can be eliminated in conditions that are expressions, e.g `if { true } ...`"
 }
 
-/// **What it does:** This lint checks for `if` conditions that use blocks containing statements, or conditions that use closures with blocks. It is `Warn` by default.
+/// **What it does:** This lint checks for `if` conditions that use blocks containing statements, or conditions that use closures with blocks.
 ///
 /// **Why is this bad?** Using blocks in the condition makes it hard to read.
 ///
index 4b3c4174df7258778ab2ee25676c53142e3329f9..03c43ef5dc8c51261083b832a0194541cb84b997 100644 (file)
@@ -20,7 +20,7 @@
 
 /// **What it does:** This lint checks for nested `if`-statements which can be collapsed by
 /// `&&`-combining their conditions and for `else { if .. }` expressions that can be collapsed to
-/// `else if ..`. It is `Warn` by default.
+/// `else if ..`.
 ///
 /// **Why is this bad?** Each `if`-statement adds one level of nesting, which makes code look more complex than it really is.
 ///
index 7eab7c1935fbaae458aaac5363c78b1c9ba9e151..b2be1dddbee109f42c4ed1e7fb6aef3ae28980ea 100644 (file)
@@ -11,7 +11,7 @@
 
 use utils::{in_macro, LimitStack, span_help_and_lint};
 
-/// **What it does:** It `Warn`s on methods with high cyclomatic complexity
+/// **What it does:** This lint checks for methods with high cyclomatic complexity
 ///
 /// **Why is this bad?** Methods of high cyclomatic complexity tend to be badly readable. Also LLVM will usually optimize small methods better.
 ///
index f7a0ca59f01a1a30df682f1e00d57185cc2f0d5f..6dc3d73419620788dc7253ef731c656f90791b97 100644 (file)
@@ -15,7 +15,7 @@
 /// **Example:**
 /// ```rust
 /// let mut lock_guard = mutex.lock();
-/// std::mem::drop(&lock_guard) //Should have been drop(lock_guard), mutex still locked
+/// std::mem::drop(&lock_guard) // Should have been drop(lock_guard), mutex still locked
 /// operation_that_requires_mutex_to_be_unlocked();
 /// ```
 declare_lint! {
index 31dc094385f707a00eb927e6dd015e5ed33dbe87..49037cd9ae7ff994d5465b8be49d56757ba15a84 100644 (file)
@@ -4,7 +4,7 @@
 
 use utils::{is_exp_equal, span_lint};
 
-/// **What it does:** This lint checks for equal operands to comparisons and bitwise binary operators (`&`, `|` and `^`). It is `Warn` by default.
+/// **What it does:** This lint checks for equal operands to comparisons and bitwise binary operators (`&`, `|` and `^`).
 ///
 /// **Why is this bad?** This is usually just a typo.
 ///
index b7bec46c3fdce21e882af0b896deeba6891fd1ac..60bfbbc59c351c165215cde504ea4f3b0de88a6b 100644 (file)
@@ -14,7 +14,7 @@
 
 pub struct EscapePass;
 
-/// **What it does:** This lint checks for usage of `Box<T>` where an unboxed `T` would work fine. It is `Warn` by default.
+/// **What it does:** This lint checks for usage of `Box<T>` where an unboxed `T` would work fine.
 ///
 /// **Why is this bad?** This is an unnecessary allocation, and bad for performance. It is only necessary to allocate if you wish to move the box into something.
 ///
index 39063f91ba3b1025cf1dc215154dc6927cac6fee..280392a50b10205b60b100c14e1e8abc97cc93a5 100644 (file)
@@ -9,7 +9,7 @@
 pub struct EtaPass;
 
 
-/// **What it does:** This lint checks for closures which just call another function where the function can be called directly. `unsafe` functions or calls where types get adjusted are ignored. It is `Warn` by default.
+/// **What it does:** This lint checks for closures which just call another function where the function can be called directly. `unsafe` functions or calls where types get adjusted are ignored.
 ///
 /// **Why is this bad?** Needlessly creating a closure just costs heap space and adds code for no benefit.
 ///
index 093c37783eb83b1d4b01db686d79c2373a781123..1a62ffb4ae0b7320d78395594f04c18c678cf141 100644 (file)
@@ -5,7 +5,7 @@
 use consts::{constant_simple, is_negative, Constant};
 use utils::{span_lint, snippet, in_macro};
 
-/// **What it does:** This lint checks for identity operations, e.g. `x + 0`. It is `Warn` by default.
+/// **What it does:** This lint checks for identity operations, e.g. `x + 0`.
 ///
 /// **Why is this bad?** This code can be removed without changing the meaning. So it just obscures what's going on. Delete it mercilessly.
 ///
index 2f061d32546c6237c1b157a3788a2bdf6ae77a10..2aa2fc6da349787c22adc89acf231ac74e45aaea 100644 (file)
@@ -5,8 +5,7 @@
 use syntax::ast::*;
 use utils::in_macro;
 
-/// **What it does:** It `Warn`s on blocks where there are items that are declared in the middle of
-/// or after the statements
+/// **What it does:** This lints checks for items declared after some statement in a block
 ///
 /// **Why is this bad?** Items live for the entire scope they are declared in. But statements are
 /// processed in order. This might cause confusion as it's hard to figure out which item is meant
index 48fc10ef23692286fa0e092cd26639d9c97a5823..120e880cde6f2131c38003944cbfb3018300d478 100644 (file)
@@ -11,7 +11,7 @@
 
 use utils::{get_item_name, snippet, span_lint, walk_ptrs_ty};
 
-/// **What it does:** This lint checks for getting the length of something via `.len()` just to compare to zero, and suggests using `.is_empty()` where applicable. It is `Warn` by default.
+/// **What it does:** This lint checks for getting the length of something via `.len()` just to compare to zero, and suggests using `.is_empty()` where applicable.
 ///
 /// **Why is this bad?** Some structures can answer `.is_empty()` much faster than calculating their length. So it is good to get into the habit of using `.is_empty()`, and having it is cheap. Besides, it makes the intent clearer than a comparison.
 ///
@@ -24,7 +24,7 @@
      could be used instead"
 }
 
-/// **What it does:** This lint checks for items that implement `.len()` but not `.is_empty()`. It is `Warn` by default.
+/// **What it does:** This lint checks for items that implement `.len()` but not `.is_empty()`.
 ///
 /// **Why is this bad?** It is good custom to have both methods, because for some data structures, asking about the length will be a costly operation, whereas `.is_empty()` can usually answer in constant time. Also it used to lead to false positives on the [`len_zero`](#len_zero) lint â€“ currently that lint will ignore such entities.
 ///
index f2f33a634bc9fc19093a5c4ded2c14f1b9446a2b..f30163f465631c136b8bbb20aec11220cb5a1e7f 100644 (file)
@@ -8,7 +8,7 @@
 
 use utils::{in_external_macro, span_lint};
 
-/// **What it does:** This lint checks for lifetime annotations which can be removed by relying on lifetime elision. It is `Warn` by default.
+/// **What it does:** This lint checks for lifetime annotations which can be removed by relying on lifetime elision.
 ///
 /// **Why is this bad?** The additional lifetimes make the code look more complicated, while there is nothing out of the ordinary going on. Removing them leads to more readable code.
 ///
@@ -22,7 +22,7 @@
      would allow omitting them"
 }
 
-/// **What it does:** This lint checks for lifetimes in generics that are never used anywhere else. It is `Warn` by default.
+/// **What it does:** This lint checks for lifetimes in generics that are never used anywhere else.
 ///
 /// **Why is this bad?** The additional lifetimes make the code look more complicated, while there is nothing out of the ordinary going on. Removing them leads to more readable code.
 ///
index bfd0e9895e57eac83534716c66647ec98607dde0..4620d6a3e818bd0e271ca28128611ff991b60cc4 100644 (file)
@@ -13,7 +13,7 @@
             span_help_and_lint, is_integer_literal, get_enclosing_block, span_lint_and_then, walk_ptrs_ty};
 use utils::{BTREEMAP_PATH, HASHMAP_PATH, LL_PATH, OPTION_PATH, RESULT_PATH, VEC_PATH};
 
-/// **What it does:** This lint checks for looping over the range of `0..len` of some collection just to get the values by index. It is `Warn` by default.
+/// **What it does:** This lint checks for looping over the range of `0..len` of some collection just to get the values by index.
 ///
 /// **Why is this bad?** Just iterating the collection itself makes the intent more clear and is probably faster.
 ///
@@ -31,7 +31,7 @@
     "for-looping over a range of indices where an iterator over items would do"
 }
 
-/// **What it does:** This lint checks for loops on `x.iter()` where `&x` will do, and suggest the latter. It is `Warn` by default.
+/// **What it does:** This lint checks for loops on `x.iter()` where `&x` will do, and suggest the latter.
 ///
 /// **Why is this bad?** Readability.
 ///
@@ -44,7 +44,7 @@
     "for-looping over `_.iter()` or `_.iter_mut()` when `&_` or `&mut _` would do"
 }
 
-/// **What it does:** This lint checks for loops on `x.next()`. It is `Warn` by default.
+/// **What it does:** This lint checks for loops on `x.next()`.
 ///
 /// **Why is this bad?** `next()` returns either `Some(value)` if there was a value, or `None` otherwise. The insidious thing is that `Option<_>` implements `IntoIterator`, so that possibly one value will be iterated, leading to some hard to find bugs. No one will want to write such code [except to win an Underhanded Rust Contest](https://www.reddit.com/r/rust/comments/3hb0wm/underhanded_rust_contest/cu5yuhr).
 ///
@@ -57,7 +57,7 @@
     "for-looping over `_.next()` which is probably not intended"
 }
 
-/// **What it does:** This lint checks for `for` loops over `Option` values. It is `Warn` by default.
+/// **What it does:** This lint checks for `for` loops over `Option` values.
 ///
 /// **Why is this bad?** Readability. This is more clearly expressed as an `if let`.
 ///
@@ -70,7 +70,7 @@
     "for-looping over an `Option`, which is more clearly expressed as an `if let`"
 }
 
-/// **What it does:** This lint checks for `for` loops over `Result` values. It is `Warn` by default.
+/// **What it does:** This lint checks for `for` loops over `Result` values.
 ///
 /// **Why is this bad?** Readability. This is more clearly expressed as an `if let`.
 ///
@@ -83,7 +83,7 @@
     "for-looping over a `Result`, which is more clearly expressed as an `if let`"
 }
 
-/// **What it does:** This lint detects `loop + match` combinations that are easier written as a `while let` loop. It is `Warn` by default.
+/// **What it does:** This lint detects `loop + match` combinations that are easier written as a `while let` loop.
 ///
 /// **Why is this bad?** The `while let` loop is usually shorter and more readable
 ///
     "`loop { if let { ... } else break }` can be written as a `while let` loop"
 }
 
-/// **What it does:** This lint checks for using `collect()` on an iterator without using the result. It is `Warn` by default.
+/// **What it does:** This lint checks for using `collect()` on an iterator without using the result.
 ///
 /// **Why is this bad?** It is more idiomatic to use a `for` loop over the iterator instead.
 ///
      written as a for loop"
 }
 
-/// **What it does:** This lint checks for loops over ranges `x..y` where both `x` and `y` are constant and `x` is greater or equal to `y`, unless the range is reversed or has a negative `.step_by(_)`. It is `Warn` by default.
+/// **What it does:** This lint checks for loops over ranges `x..y` where both `x` and `y` are constant and `x` is greater or equal to `y`, unless the range is reversed or has a negative `.step_by(_)`.
 ///
 /// **Why is it bad?** Such loops will either be skipped or loop until wrap-around (in debug code, this may `panic!()`). Both options are probably not intended.
 ///
     "Iterating over an empty range, such as `10..0` or `5..5`"
 }
 
-/// **What it does:** This lint checks `for` loops over slices with an explicit counter and suggests the use of `.enumerate()`. It is `Warn` by default.
+/// **What it does:** This lint checks `for` loops over slices with an explicit counter and suggests the use of `.enumerate()`.
 ///
 /// **Why is it bad?** Not only is the version using `.enumerate()` more readable, the compiler is able to remove bounds checks which can lead to faster code in some instances.
 ///
     "for-looping with an explicit counter when `_.enumerate()` would do"
 }
 
-/// **What it does:** This lint checks for empty `loop` expressions. It is `Warn` by default.
+/// **What it does:** This lint checks for empty `loop` expressions.
 ///
 /// **Why is this bad?** Those busy loops burn CPU cycles without doing anything. Think of the environment and either block on something or at least make the thread sleep for some microseconds.
 ///
     "empty `loop {}` detected"
 }
 
-/// **What it does:** This lint checks for `while let` expressions on iterators. It is `Warn` by default.
+/// **What it does:** This lint checks for `while let` expressions on iterators.
 ///
 /// **Why is this bad?** Readability. A simple `for` loop is shorter and conveys the intent better.
 ///
index d47739863993e5653dba47a94729474c67478107..e0255c52fb513e4cebff70c2ccdcaebf88530ae7 100644 (file)
@@ -4,7 +4,7 @@
 use utils::{is_adjusted, match_path, match_trait_method, match_type, snippet, span_help_and_lint};
 use utils::{walk_ptrs_ty, walk_ptrs_ty_depth};
 
-/// **What it does:** This lint checks for mapping clone() over an iterator. It is `Warn` by default and suggests to use `.cloned()` instead.
+/// **What it does:** This lint checks for mapping clone() over an iterator.
 ///
 /// **Why is this bad?** It makes the code less readable.
 ///
index fb0663117fa62ccdfacc6026b36d01c97a5b1fbe..6be5d0bf24f72b5b4f11d25ad21f6a591a32b698 100644 (file)
@@ -11,7 +11,7 @@
 use utils::{COW_PATH, OPTION_PATH, RESULT_PATH};
 use utils::{match_type, snippet, span_lint, span_note_and_lint, span_lint_and_then, in_external_macro, expr_block};
 
-/// **What it does:** This lint checks for matches with a single arm where an `if let` will usually suffice. It is `Warn` by default.
+/// **What it does:** This lint checks for matches with a single arm where an `if let` will usually suffice.
 ///
 /// **Why is this bad?** Just readability â€“ `if let` nests less than a `match`.
 ///
@@ -30,7 +30,7 @@
      is `_ => {}`) is used; recommends `if let` instead"
 }
 
-/// **What it does:** This lint checks for matches with a two arms where an `if let` will usually suffice. It is `Allow` by default.
+/// **What it does:** This lint checks for matches with a two arms where an `if let` will usually suffice.
 ///
 /// **Why is this bad?** Just readability â€“ `if let` nests less than a `match`.
 ///
@@ -49,7 +49,7 @@
      recommends `if let` instead"
 }
 
-/// **What it does:** This lint checks for matches where all arms match a reference, suggesting to remove the reference and deref the matched expression instead. It also checks for `if let &foo = bar` blocks. It is `Warn` by default.
+/// **What it does:** This lint checks for matches where all arms match a reference, suggesting to remove the reference and deref the matched expression instead. It also checks for `if let &foo = bar` blocks.
 ///
 /// **Why is this bad?** It just makes the code less readable. That reference destructuring adds nothing to the code.
 ///
@@ -70,7 +70,7 @@
      dereferenced instead"
 }
 
-/// **What it does:** This lint checks for matches where match expression is a `bool`. It suggests to replace the expression with an `if...else` block. It is `Warn` by default.
+/// **What it does:** This lint checks for matches where match expression is a `bool`. It suggests to replace the expression with an `if...else` block.
 ///
 /// **Why is this bad?** It makes the code less readable.
 ///
@@ -90,7 +90,7 @@
     "a match on boolean expression; recommends `if..else` block instead"
 }
 
-/// **What it does:** This lint checks for overlapping match arms. It is `Warn` by default.
+/// **What it does:** This lint checks for overlapping match arms.
 ///
 /// **Why is this bad?** It is likely to be an error and if not, makes the code less obvious.
 ///
index 4cd957d0fe72138acde06440f85eb00fc7d39513..40d975545e9f609a48cd031486288e8a7601f3ba 100644 (file)
@@ -18,7 +18,7 @@
 #[derive(Clone)]
 pub struct MethodsPass;
 
-/// **What it does:** This lint checks for `.unwrap()` calls on `Option`s. It is `Allow` by default.
+/// **What it does:** This lint checks for `.unwrap()` calls on `Option`s.
 ///
 /// **Why is this bad?** Usually it is better to handle the `None` case, or to at least call `.expect(_)` with a more helpful message. Still, for a lot of quick-and-dirty code, `unwrap` is a good choice, which is why this lint is `Allow` by default.
 ///
@@ -30,7 +30,7 @@
     "using `Option.unwrap()`, which should at least get a better message using `expect()`"
 }
 
-/// **What it does:** This lint checks for `.unwrap()` calls on `Result`s. It is `Allow` by default.
+/// **What it does:** This lint checks for `.unwrap()` calls on `Result`s.
 ///
 /// **Why is this bad?** `result.unwrap()` will let the thread panic on `Err` values. Normally, you want to implement more sophisticated error handling, and propagate errors upwards with `try!`.
 ///
@@ -44,7 +44,7 @@
     "using `Result.unwrap()`, which might be better handled"
 }
 
-/// **What it does:** This lint checks for `.to_string()` method calls on values of type `&str`. It is `Warn` by default.
+/// **What it does:** This lint checks for `.to_string()` method calls on values of type `&str`.
 ///
 /// **Why is this bad?** This uses the whole formatting machinery just to clone a string. Using `.to_owned()` is lighter on resources. You can also consider using a [`Cow<'a, str>`](http://doc.rust-lang.org/std/borrow/enum.Cow.html) instead in some cases.
 ///
@@ -56,7 +56,7 @@
     "using `to_string()` on a str, which should be `to_owned()`"
 }
 
-/// **What it does:** This lint checks for `.to_string()` method calls on values of type `String`. It is `Warn` by default.
+/// **What it does:** This lint checks for `.to_string()` method calls on values of type `String`.
 ///
 /// **Why is this bad?** This is an non-efficient way to clone a `String`, `.clone()` should be used
 /// instead. `String` implements `ToString` mostly for generics.
@@ -69,7 +69,7 @@
     "calling `String::to_string` which is inefficient"
 }
 
-/// **What it does:** This lint checks for methods that should live in a trait implementation of a `std` trait (see [llogiq's blog post](http://llogiq.github.io/2015/07/30/traits.html) for further information) instead of an inherent implementation. It is `Warn` by default.
+/// **What it does:** This lint checks for methods that should live in a trait implementation of a `std` trait (see [llogiq's blog post](http://llogiq.github.io/2015/07/30/traits.html) for further information) instead of an inherent implementation.
 ///
 /// **Why is this bad?** Implementing the traits improve ergonomics for users of the code, often with very little cost. Also people seeing a `mul(..)` method may expect `*` to work equally, so you should have good reason to disappoint them.
 ///
@@ -87,7 +87,7 @@
     "defining a method that should be implementing a std trait"
 }
 
-/// **What it does:** This lint checks for methods with certain name prefixes and `Warn`s (by default) if the prefix doesn't match how self is taken. The actual rules are:
+/// **What it does:** This lint checks for methods with certain name prefixes and which doesn't match how self is taken. The actual rules are:
 ///
 /// |Prefix |`self` taken        |
 /// |-------|--------------------|
@@ -97,7 +97,7 @@
 /// |`is_`  |`&self` or none     |
 /// |`to_`  |`&self`             |
 ///
-/// **Why is this bad?** Consistency breeds readability. If you follow the conventions, your users won't be surprised that they e.g. need to supply a mutable reference to a `as_`.. function.
+/// **Why is this bad?** Consistency breeds readability. If you follow the conventions, your users won't be surprised that they e.g. need to supply a mutable reference to a `as_..` function.
 ///
 /// **Known problems:** None
 ///
      `self` with the wrong convention"
 }
 
-/// **What it does:** This is the same as [`wrong_self_convention`](#wrong_self_convention), but for public items. This lint is `Allow` by default.
+/// **What it does:** This is the same as [`wrong_self_convention`](#wrong_self_convention), but for public items.
 ///
 /// **Why is this bad?** See [`wrong_self_convention`](#wrong_self_convention).
 ///
      `self` with the wrong convention"
 }
 
-/// **What it does:** This lint `Warn`s on using `ok().expect(..)`.
+/// **What it does:** This lint checks for usage of `ok().expect(..)`.
 ///
 /// **Why is this bad?** Because you usually call `expect()` on the `Result` directly to get a good error message.
 ///
      calling `expect` directly on the Result"
 }
 
-/// **What it does:** This lint `Warn`s on `_.map(_).unwrap_or(_)`.
+/// **What it does:** This lint checks for usage of `_.map(_).unwrap_or(_)`.
 ///
 /// **Why is this bad?** Readability, this can be written more concisely as `_.map_or(_, _)`.
 ///
     "using any `*or` method when the `*or_else` would do"
 }
 
-/// **What it does:** This lint `Warn`s on using `.extend(s)` on a `vec` to extend the vec by a slice.
+/// **What it does:** This lint checks for usage of `.extend(s)` on a `Vec` to extend the vector by a slice.
 ///
 /// **Why is this bad?** Since Rust 1.6, the `extend_from_slice(_)` method is stable and at least for now faster.
 ///
index 2e1993455792a088cbfcea5df1f92bf343aaf448..57ec9d9173436d3909877aaeee20c73c489200d2 100644 (file)
@@ -8,7 +8,7 @@
 use utils::{match_def_path, span_lint};
 use self::MinMax::{Min, Max};
 
-/// **What it does:** This lint checks for expressions where `std::cmp::min` and `max` are used to clamp values, but switched so that the result is constant. It is `Warn` by default.
+/// **What it does:** This lint checks for expressions where `std::cmp::min` and `max` are used to clamp values, but switched so that the result is constant.
 ///
 /// **Why is this bad?** This is in all probability not the intended outcome. At the least it hurts readability of the code.
 ///
index 099b1797e8e1316cce6148d8577eeec1defeb646..c0aed78225a6df415196dc6231d5eb0ecb92a154 100644 (file)
@@ -13,7 +13,7 @@
 use utils::{get_item_name, match_path, snippet, get_parent_expr, span_lint};
 use utils::{span_help_and_lint, walk_ptrs_ty, is_integer_literal, implements_trait};
 
-/// **What it does:** This lint checks for function arguments and let bindings denoted as `ref`. It is `Warn` by default.
+/// **What it does:** This lint checks for function arguments and let bindings denoted as `ref`.
 ///
 /// **Why is this bad?** The `ref` declaration makes the function take an owned value, but turns the argument into a reference (which means that the value is destroyed when exiting the function). This adds not much value: either take a reference type, or take an owned value and create references in the body.
 ///
@@ -78,7 +78,7 @@ fn check_stmt(&mut self, cx: &LateContext, s: &Stmt) {
     }
 }
 
-/// **What it does:** This lint checks for comparisons to NAN. It is `Deny` by default.
+/// **What it does:** This lint checks for comparisons to NAN.
 ///
 /// **Why is this bad?** NAN does not compare meaningfully to anything â€“ not even itself â€“ so those comparisons are simply wrong.
 ///
@@ -123,7 +123,7 @@ fn check_nan(cx: &LateContext, path: &Path, span: Span) {
     });
 }
 
-/// **What it does:** This lint checks for (in-)equality comparisons on floating-point values (apart from zero), except in functions called `*eq*` (which probably implement equality for a type involving floats). It is `Warn` by default.
+/// **What it does:** This lint checks for (in-)equality comparisons on floating-point values (apart from zero), except in functions called `*eq*` (which probably implement equality for a type involving floats).
 ///
 /// **Why is this bad?** Floating point calculations are usually imprecise, so asking if two values are *exactly* equal is asking for trouble. For a good guide on what to do, see [the floating point guide](http://www.floating-point-gui.de/errors/comparison).
 ///
@@ -189,7 +189,7 @@ fn is_float(cx: &LateContext, expr: &Expr) -> bool {
     }
 }
 
-/// **What it does:** This lint checks for conversions to owned values just for the sake of a comparison. It is `Warn` by default.
+/// **What it does:** This lint checks for conversions to owned values just for the sake of a comparison.
 ///
 /// **Why is this bad?** The comparison can operate on a reference, so creating an owned value effectively throws it away directly afterwards, which is needlessly consuming code and heap space.
 ///
@@ -283,7 +283,7 @@ fn is_str_arg(cx: &LateContext, args: &[P<Expr>]) -> bool {
     }
 }
 
-/// **What it does:** This lint checks for getting the remainder of a division by one. It is `Warn` by default.
+/// **What it does:** This lint checks for getting the remainder of a division by one.
 ///
 /// **Why is this bad?** The result can only ever be zero. No one will write such code deliberately, unless trying to win an Underhanded Rust Contest. Even for that contest, it's probably a bad idea. Use something more underhanded.
 ///
@@ -313,7 +313,7 @@ fn check_expr(&mut self, cx: &LateContext, expr: &Expr) {
     }
 }
 
-/// **What it does:** This lint checks for patterns in the form `name @ _`. It is `Warn` by default.
+/// **What it does:** This lint checks for patterns in the form `name @ _`.
 ///
 /// **Why is this bad?** It's almost always more readable to just use direct bindings.
 ///
index de3c428935375bfbf9689c4ecf4dc0d7d31cd0e3..59a0102aacf08661244c4fa6f269e478638cf2b0 100644 (file)
@@ -8,7 +8,7 @@
 
 use utils::{span_lint, span_help_and_lint};
 
-/// **What it does:** This lint `Warn`s on struct field patterns bound to wildcards.
+/// **What it does:** This lint checks for structure field patterns bound to wildcards.
 ///
 /// **Why is this bad?** Using `..` instead is shorter and leaves the focus on the fields that are actually bound.
 ///
@@ -20,7 +20,7 @@
     "Struct fields are bound to a wildcard instead of using `..`"
 }
 
-/// **What it does:** This lint `Warn`s on function arguments having the similar names differing by an underscore
+/// **What it does:** This lint checks for function arguments having the similar names differing by an underscore
 ///
 /// **Why is this bad?** It affects code readability
 ///
index 99c1d040fd2b4fad427f132cfd265ee2aea7ef70..1759a89242b2e29bd2714e953f6595175c1764b1 100644 (file)
@@ -4,7 +4,7 @@
 
 use utils::{in_external_macro, span_lint};
 
-/// **What it does:** This lint checks for instances of `mut mut` references. It is `Warn` by default.
+/// **What it does:** This lint checks for instances of `mut mut` references.
 ///
 /// **Why is this bad?** Multiple `mut`s don't add anything meaningful to the source.
 ///
index 15e8d310cd6336e3ea80077f38e548942482cee2..35904533719d676ac1214037085af7ba2502a7fd 100644 (file)
@@ -4,7 +4,7 @@
 use rustc::middle::ty::{TypeAndMut, TypeVariants, MethodCall, TyS};
 use syntax::ptr::P;
 
-/// **What it does:** This lint detects giving a mutable reference to a function that only requires an immutable reference. It is `Warn` by default.
+/// **What it does:** This lint detects giving a mutable reference to a function that only requires an immutable reference.
 ///
 /// **Why is this bad?** The immutable reference rules out all other references to the value. Also the code misleads about the intent of the call site.
 ///
index 7b75bd747bb9e34aacda18fefd5781441c1cca31..cf1c347750c89f6e62f60b15ebe23b4471e6d0b2 100644 (file)
@@ -11,7 +11,7 @@
 
 use utils::{span_lint, MUTEX_PATH, match_type};
 
-/// **What it does:** It `Warn`s on usages of `Mutex<X>` where an atomic will do
+/// **What it does:** This lint checks for usages of `Mutex<X>` where an atomic will do.
 ///
 /// **Why is this bad?** Using a Mutex just to make access to a plain bool or reference sequential is shooting flies with cannons. `std::atomic::AtomicBool` and `std::atomic::AtomicPtr` are leaner and faster.
 ///
@@ -24,7 +24,7 @@
     "using a Mutex where an atomic value could be used instead"
 }
 
-/// **What it does:** It `Warn`s on usages of `Mutex<X>` where `X` is an integral type.
+/// **What it does:** This lint checks for usages of `Mutex<X>` where `X` is an integral type.
 ///
 /// **Why is this bad?** Using a Mutex just to make access to a plain integer sequential is shooting flies with cannons. `std::atomic::usize` is leaner and faster.
 ///
index 22edbc272bddb69f55629ae81828da750c73c3ee..52b3108f6fae6bc05da40934d46abe8d5eb65e59 100644 (file)
@@ -9,7 +9,7 @@
 
 use utils::{span_lint, snippet};
 
-/// **What it does:** This lint checks for expressions of the form `if c { true } else { false }` (or vice versa) and suggest using the condition directly. It is `Warn` by default.
+/// **What it does:** This lint checks for expressions of the form `if c { true } else { false }` (or vice versa) and suggest using the condition directly.
 ///
 /// **Why is this bad?** Redundant code.
 ///
index 2c293d046005e35f015f7c3616acc1dd859ef363..646ebbbd0159d36c70c647de56670f050867b499 100644 (file)
@@ -8,7 +8,7 @@
 use utils::span_lint;
 use utils;
 
-/// **What it does:** This lint `Warn`s on use of the `as_slice(..)` function, which is unstable.
+/// **What it does:** This lint checks for usage of the `as_slice(..)` function, which is unstable.
 ///
 /// **Why is this bad?** Using this function doesn't make your code better, but it will preclude it from building with stable Rust.
 ///
@@ -22,7 +22,7 @@
 see https://github.com/rust-lang/rust/issues/27729"
 }
 
-/// **What it does:** This lint `Warn`s on use of the `as_mut_slice(..)` function, which is unstable.
+/// **What it does:** This lint checks for usage of the `as_mut_slice(..)` function, which is unstable.
 ///
 /// **Why is this bad?** Using this function doesn't make your code better, but it will preclude it from building with stable Rust.
 ///
index 1b306df8eed540300769506be143ca2e78cf8cf0..d18930c8cccec08590cd5666c3bce335c2a8357c 100644 (file)
@@ -4,7 +4,7 @@
 
 use utils::span_lint;
 
-/// **What it does:** This lint `Warn`s on needlessly including a base struct on update when all fields are changed anyway.
+/// **What it does:** This lint warns on needlessly including a base struct on update when all fields are changed anyway.
 ///
 /// **Why is this bad?** This will cost resources (because the base has to be somewhere), and make the code less readable.
 ///
index 075b9b628005abff4e8eeb4650232ae2cf046634..e1067f27ab9d8d99b37f22e2b4fdcd62df40d905 100644 (file)
@@ -6,7 +6,7 @@
 use utils::in_macro;
 use utils::span_lint;
 
-/// **What it does:** This lint `Warn`s on statements which have no effect.
+/// **What it does:** This lint checks for statements which have no effect.
 ///
 /// **Why is this bad?** Similar to dead code, these statements are actually executed. However, as they have no effect, all they do is make the code less readable.
 ///
index 541ed2444f484110ff4b3954d0ff1c43be4cc892..a5766604cec44ea757755677a3d8584843788353 100644 (file)
@@ -4,7 +4,7 @@
 use syntax::codemap::{Span, Spanned};
 use syntax::ast::Lit_::LitBool;
 
-/// **What it does:** This lint checks for duplicate open options as well as combinations that make no sense. It is `Warn` by default.
+/// **What it does:** This lint checks for duplicate open options as well as combinations that make no sense.
 ///
 /// **Why is this bad?** In the best case, the code will be harder to read than necessary. I don't know the worst case.
 ///
index dc30f710830000a1dc0bff370e97a4741213654e..5337942b4e0f726845fe274ab08612042053ea7d 100644 (file)
@@ -4,14 +4,14 @@
 
 use utils::{span_lint, in_external_macro, match_path, BEGIN_UNWIND};
 
-/// **What it does:** Warn about missing parameters in `panic!`.
+/// **What it does:** This lint checks for missing parameters in `panic!`.
 ///
 /// **Known problems:** Should you want to use curly brackets in `panic!` without any parameter,
 /// this lint will warn.
 ///
 /// **Example:**
 /// ```
-/// panic!("This panic! is probably missing a parameter there: {}");
+/// panic!("This `panic!` is probably missing a parameter there: {}");
 /// ```
 declare_lint! {
     pub PANIC_PARAMS, Warn, "missing parameters in `panic!`"
index a316f183863442a1da90c38e83009f270a6ba47b..009a79b1673bd514e7ccb0af74afa9344e56fc99 100644 (file)
@@ -4,7 +4,7 @@
 
 use utils::{span_lint, snippet};
 
-/// **What it does:** This lint checks for operations where precedence may be unclear and `Warn`s about them by default, suggesting to add parentheses. Currently it catches the following:
+/// **What it does:** This lint checks for operations where precedence may be unclear and suggests to add parentheses. Currently it catches the following:
 /// * mixed usage of arithmetic and bit shifting/combining operators without parentheses
 /// * a "negative" numeric literal (which is really a unary `-` followed by a numeric literal) followed by a method call
 ///
index 930952bdbaf89363dece0c4dc87dddc114d472a1..d8f5fd488aa9cccc65c991cce99af6239619dbf5 100644 (file)
@@ -2,8 +2,7 @@
 use rustc_front::hir::*;
 use utils::{IO_PRINT_PATH, is_expn_of, match_path, span_lint};
 
-/// **What it does:** This lint warns whenever you print on *stdout*. This lint is `Allow` by
-/// default, the purpose is to catch debugging remnants.
+/// **What it does:** This lint warns whenever you print on *stdout*. The purpose of this lint is to catch debugging remnants.
 ///
 /// **Why is this bad?** People often print on *stdout* while debugging an application and might
 /// forget to remove those prints afterward.
index 75ce96f63505da580332784e13884d05248c1d43..707adcfeb07cd2f57b07ad2f7c9a225763457b06 100644 (file)
@@ -10,7 +10,7 @@
 use utils::{span_lint, match_type};
 use utils::{STRING_PATH, VEC_PATH};
 
-/// **What it does:** This lint checks for function arguments of type `&String` or `&Vec` unless the references are mutable. It is `Warn` by default.
+/// **What it does:** This lint checks for function arguments of type `&String` or `&Vec` unless the references are mutable.
 ///
 /// **Why is this bad?** Requiring the argument to be of the specific size makes the function less useful for no benefit; slices in the form of `&[T]` or `&str` usually suffice and can be obtained from other types, too.
 ///
index 692a5a2da1db8e6b1f27e4b7ec0782cf2f27e7ba..895bd180168735404790a82609bb2cb0095619f2 100644 (file)
@@ -3,7 +3,7 @@
 use syntax::codemap::Spanned;
 use utils::{is_integer_literal, match_type, snippet};
 
-/// **What it does:** This lint checks for iterating over ranges with a `.step_by(0)`, which never terminates. It is `Warn` by default.
+/// **What it does:** This lint checks for iterating over ranges with a `.step_by(0)`, which never terminates.
 ///
 /// **Why is this bad?** This very much looks like an oversight, since with `loop { .. }` there is an obvious better way to endlessly loop.
 ///
@@ -14,7 +14,7 @@
     pub RANGE_STEP_BY_ZERO, Warn,
     "using Range::step_by(0), which produces an infinite iterator"
 }
-/// **What it does:** This lint checks for zipping a collection with the range of `0.._.len()`. It is `Warn` by default.
+/// **What it does:** This lint checks for zipping a collection with the range of `0.._.len()`.
 ///
 /// **Why is this bad?** The code is better expressed with `.enumerate()`.
 ///
index 259bbb1b64bd7667471a8f25c4c6389f5c102be0..81193793a2360c307990576788656c90b09752ec 100644 (file)
@@ -10,7 +10,7 @@
 
 use utils::{match_path, REGEX_NEW_PATH, span_lint};
 
-/// **What it does:** This lint checks `Regex::new(_)` invocations for correct regex syntax. It is `deny` by default.
+/// **What it does:** This lint checks `Regex::new(_)` invocations for correct regex syntax.
 ///
 /// **Why is this bad?** This will lead to a runtime panic.
 ///
index 0b0c4d14bdfe1d6d83ca8f4ffa7375ac3dde8132..3d830e9e372d83715e9e29f530e254039c6d7352 100644 (file)
@@ -6,7 +6,7 @@
 
 use utils::{span_lint, span_lint_and_then, snippet_opt, match_path_ast, in_external_macro};
 
-/// **What it does:** This lint checks for return statements at the end of a block. It is `Warn` by default.
+/// **What it does:** This lint checks for return statements at the end of a block.
 ///
 /// **Why is this bad?** Removing the `return` and semicolon will make the code more rusty.
 ///
@@ -18,7 +18,7 @@
     "using a return statement like `return expr;` where an expression would suffice"
 }
 
-/// **What it does:** This lint checks for `let`-bindings, which are subsequently returned. It is `Warn` by default.
+/// **What it does:** This lint checks for `let`-bindings, which are subsequently returned.
 ///
 /// **Why is this bad?** It is just extraneous code. Remove it to make your code more rusty.
 ///
index f772f97c81e88ce220b69421074584e5fa846e0c..ff9ea47f065f19b77c37738990b9b1bbc96558d5 100644 (file)
@@ -9,7 +9,7 @@
 
 use utils::{is_from_for_desugar, in_external_macro, snippet, span_lint, span_note_and_lint, DiagnosticWrapper};
 
-/// **What it does:** This lint checks for bindings that shadow other bindings already in scope, while just changing reference level or mutability. It is `Allow` by default.
+/// **What it does:** This lint checks for bindings that shadow other bindings already in scope, while just changing reference level or mutability.
 ///
 /// **Why is this bad?** Not much, in fact it's a very common pattern in Rust code. Still, some may opt to avoid it in their code base, they can set this lint to `Warn`.
 ///
@@ -21,7 +21,7 @@
     "rebinding a name to itself, e.g. `let mut x = &mut x`"
 }
 
-/// **What it does:** This lint checks for bindings that shadow other bindings already in scope, while reusing the original value. It is `Allow` by default.
+/// **What it does:** This lint checks for bindings that shadow other bindings already in scope, while reusing the original value.
 ///
 /// **Why is this bad?** Not too much, in fact it's a common pattern in Rust code. Still, some argue that name shadowing like this hurts readability, because a value may be bound to different things depending on position in the code.
 ///
@@ -34,7 +34,7 @@
     `let x = x + 1`"
 }
 
-/// **What it does:** This lint checks for bindings that shadow other bindings already in scope, either without a initialization or with one that does not even use the original value. This lint is `Warn` by default.
+/// **What it does:** This lint checks for bindings that shadow other bindings already in scope, either without a initialization or with one that does not even use the original value.
 ///
 /// **Why is this bad?** Name shadowing can hurt readability, especially in large code bases, because it is easy to lose track of the active binding at any place in the code. This can be alleviated by either giving more specific names to bindings ore introducing more scopes to contain the bindings.
 ///
index 16ee08b1894936fba4671690cad29cceffbc900d..f1a1341460e68d4fd57d10aa367cb71dafb6e93e 100644 (file)
@@ -10,7 +10,7 @@
 use utils::{is_exp_equal, match_type, span_lint, walk_ptrs_ty, get_parent_expr};
 use utils::STRING_PATH;
 
-/// **What it does:** This lint matches code of the form `x = x + y` (without `let`!). It is `Allow` by default.
+/// **What it does:** This lint matches code of the form `x = x + y` (without `let`!).
 ///
 /// **Why is this bad?** Because this expression needs another copy as opposed to `x.push_str(y)` (in practice LLVM will usually elide it, though). Despite [llogiq](https://github.com/llogiq)'s reservations, this lint also is `allow` by default, as some people opine that it's more readable.
 ///
@@ -28,7 +28,7 @@
     "using `x = x + ..` where x is a `String`; suggests using `push_str()` instead"
 }
 
-/// **What it does:** The `string_add` lint matches all instances of `x + _` where `x` is of type `String`, but only if [`string_add_assign`](#string_add_assign) does *not* match.  It is `Allow` by default.
+/// **What it does:** The `string_add` lint matches all instances of `x + _` where `x` is of type `String`, but only if [`string_add_assign`](#string_add_assign) does *not* match.
 ///
 /// **Why is this bad?** It's not bad in and of itself. However, this particular `Add` implementation is asymmetric (the other operand need not be `String`, but `x` does), while addition as mathematically defined is symmetric, also the `String::push_str(_)` function is a perfectly good replacement. Therefore some dislike it and wish not to have it in their code.
 ///
@@ -49,7 +49,7 @@
 }
 
 /// **What it does:** This lint matches the `as_bytes` method called on string
-/// literals that contain only ascii characters. It is `Warn` by default.
+/// literals that contain only ascii characters.
 ///
 /// **Why is this bad?** Byte string literals (e.g. `b"foo"`) can be used instead. They are shorter but less discoverable than `as_bytes()`.
 ///
index 7d5057d8377864b47fb425f2bc95d8beec5fbc07..417ec540856c4bf58dc91b41b7c6d3c2f8a85185 100644 (file)
@@ -4,9 +4,9 @@
 use utils::is_adjusted;
 use utils::span_lint;
 
-/// **What it does:** This lint `Warn`s on creating a struct or tuple just to assign a value in it.
+/// **What it does:** This lint checks for construction of a structure or tuple just to assign a value in it.
 ///
-/// **Why is this bad?** Readability. If the struct is only created to be updated, why not write the struct you want in the first place?
+/// **Why is this bad?** Readability. If the structure is only created to be updated, why not write the structure you want in the first place?
 ///
 /// **Known problems:** None.
 ///
index 24af45bc68d1232877f94a100b5cdfd00c631c16..0dd5b60e77adc161d8f6643c2eb4101122402693 100644 (file)
@@ -2,7 +2,7 @@
 use rustc_front::hir::*;
 use utils;
 
-/// **What it does:** This lint checks for transmutes to the original type of the object. It is `Warn` by default.
+/// **What it does:** This lint checks for transmutes to the original type of the object.
 ///
 /// **Why is this bad?** Readability. The code tricks people into thinking that the original value was of some other type.
 ///
index bb1201547b38aa6a298d9e0429b2ac19cca024a5..498a084984f750d2b54ee8ea196fff128415bd93 100644 (file)
@@ -15,7 +15,7 @@
 #[allow(missing_copy_implementations)]
 pub struct TypePass;
 
-/// **What it does:** This lint checks for use of `Box<Vec<_>>` anywhere in the code. It is `Warn` by default.
+/// **What it does:** This lint checks for use of `Box<Vec<_>>` anywhere in the code.
 ///
 /// **Why is this bad?** `Vec` already keeps its contents in a separate area on the heap. So if you `Box` it, you just add another level of indirection without any benefit whatsoever.
 ///
@@ -27,7 +27,7 @@
     "usage of `Box<Vec<T>>`, vector elements are already on the heap"
 }
 
-/// **What it does:** This lint checks for usage of any `LinkedList`, suggesting to use a `Vec` or a `VecDeque` (formerly called `RingBuf`). It is `Warn` by default.
+/// **What it does:** This lint checks for usage of any `LinkedList`, suggesting to use a `Vec` or a `VecDeque` (formerly called `RingBuf`).
 ///
 /// **Why is this bad?** Gankro says:
 ///
@@ -78,7 +78,7 @@ fn check_ty(&mut self, cx: &LateContext, ast_ty: &Ty) {
 #[allow(missing_copy_implementations)]
 pub struct LetPass;
 
-/// **What it does:** This lint checks for binding a unit value. It is `Warn` by default.
+/// **What it does:** This lint checks for binding a unit value.
 ///
 /// **Why is this bad?** A unit value cannot usefully be used anywhere. So binding one is kind of pointless.
 ///
@@ -121,7 +121,7 @@ fn check_decl(&mut self, cx: &LateContext, decl: &Decl) {
     }
 }
 
-/// **What it does:** This lint checks for comparisons to unit. It is `Warn` by default.
+/// **What it does:** This lint checks for comparisons to unit.
 ///
 /// **Why is this bad?** Unit is always equal to itself, and thus is just a clumsily written constant. Mostly this happens when someone accidentally adds semicolons at the end of the operands.
 ///
@@ -405,7 +405,7 @@ fn check_expr(&mut self, cx: &LateContext, expr: &Expr) {
     }
 }
 
-/// **What it does:** This lint checks for types used in structs, parameters and `let` declarations above a certain complexity threshold. It is `Warn` by default.
+/// **What it does:** This lint checks for types used in structs, parameters and `let` declarations above a certain complexity threshold.
 ///
 /// **Why is this bad?** Too complex types make the code less readable. Consider using a `type` definition to simplify them.
 ///
@@ -539,7 +539,7 @@ fn visit_ty(&mut self, ty: &'v Ty) {
     }
 }
 
-/// **What it does:** This lint points out expressions where a character literal is casted to u8 and suggests using a byte literal instead.
+/// **What it does:** This lint points out expressions where a character literal is casted to `u8` and suggests using a byte literal instead.
 ///
 /// **Why is this bad?** In general, casting values to smaller types is error-prone and should be avoided where possible. In the particular case of converting a character literal to u8, it is easy to avoid by just using a byte literal instead. As an added bonus, `b'a'` is even slightly shorter than `'a' as u8`.
 ///
index 92d365f0323c38371e201c3dd44d89a22fcc7ed8..63ffe219d9bf461773f9dbbea483c90343e3ca0e 100644 (file)
@@ -8,7 +8,7 @@
 
 use utils::{snippet, span_help_and_lint};
 
-/// **What it does:** This lint checks for the unicode zero-width space in the code. It is `Warn` by default.
+/// **What it does:** This lint checks for the unicode zero-width space in the code.
 ///
 /// **Why is this bad?** Having an invisible character in the code makes for all sorts of April fools, but otherwise is very much frowned upon.
 ///
@@ -20,7 +20,7 @@
     "using a zero-width space in a string literal, which is confusing"
 }
 
-/// **What it does:** This lint checks for non-ascii characters in string literals. It is `Allow` by default.
+/// **What it does:** This lint checks for non-ascii characters in string literals.
 ///
 /// **Why is this bad?** Yeah, we know, the 90's called and wanted their charset back. Even so, there still are editors and other programs out there that don't work well with unicode. So if the code is meant to be used internationally, on multiple operating systems, or has other portability requirements, activating this lint could be useful.
 ///
@@ -33,7 +33,7 @@
      using the \\u escape instead"
 }
 
-/// **What it does:** This lint checks for string literals that contain unicode in a form that is not equal to its [NFC-recomposition](http://www.unicode.org/reports/tr15/#Norm_Forms). This lint is `Allow` by default.
+/// **What it does:** This lint checks for string literals that contain unicode in a form that is not equal to its [NFC-recomposition](http://www.unicode.org/reports/tr15/#Norm_Forms).
 ///
 /// **Why is this bad?** If such a string is compared to another, the results may be surprising.
 ///
index 41a477c34ff0c6cd2ec7e4a9dc5f9298b895f90d..fe3c1f901991ea19f225d8728ce574be0e336616 100644 (file)
@@ -7,7 +7,6 @@
 use utils::{is_expn_of, match_path, snippet, span_lint_and_then};
 
 /// **What it does:** This lint warns about using `&vec![..]` when using `&[..]` would be possible.
-/// It is `Warn` by default.
 ///
 /// **Why is this bad?** This is less efficient.
 ///
index 9c5c07cd6783be998ddfd0d7356e8c5a28cc671c..1576d699a4ab83bd5ba5ff7d8c217a90d40f2a17 100644 (file)
@@ -4,12 +4,12 @@
 use utils::span_help_and_lint;
 use consts::{Constant, constant_simple, FloatWidth};
 
-/// ZeroDivZeroPass is a pass that checks for a binary expression that consists
-/// of 0.0/0.0, which is always NaN. It is more clear to replace instances of
-/// 0.0/0.0 with std::f32::NaN or std::f64::NaN, depending on the precision.
+/// `ZeroDivZeroPass` is a pass that checks for a binary expression that consists
+/// `of 0.0/0.0`, which is always NaN. It is more clear to replace instances of
+/// `0.0/0.0` with `std::f32::NaN` or `std::f64::NaN`, depending on the precision.
 pub struct ZeroDivZeroPass;
 
-/// **What it does:** This lint checks for `0.0 / 0.0`. It is `Warn` by default.
+/// **What it does:** This lint checks for `0.0 / 0.0`.
 ///
 /// **Why is this bad?** It's less readable than `std::f32::NAN` or `std::f64::NAN`
 ///