Also add "known problem" to the description, with link to #1586.
[needless_return](https://github.com/Manishearth/rust-clippy/wiki#needless_return) | warn | using a return statement like `return expr;` where an expression would suffice
[needless_update](https://github.com/Manishearth/rust-clippy/wiki#needless_update) | warn | using `Foo { ..base }` when there are no missing fields
[neg_multiply](https://github.com/Manishearth/rust-clippy/wiki#neg_multiply) | warn | multiplying integers with -1
-[never_loop](https://github.com/Manishearth/rust-clippy/wiki#never_loop) | warn | any loop with an unconditional `break` statement
+[never_loop](https://github.com/Manishearth/rust-clippy/wiki#never_loop) | allow | any loop with an unconditional `break` or `return` statement
[new_ret_no_self](https://github.com/Manishearth/rust-clippy/wiki#new_ret_no_self) | warn | not returning `Self` in a `new` method
[new_without_default](https://github.com/Manishearth/rust-clippy/wiki#new_without_default) | warn | `fn new() -> Self` method without `Default` implementation
[new_without_default_derive](https://github.com/Manishearth/rust-clippy/wiki#new_without_default_derive) | warn | `fn new() -> Self` without `#[derive]`able `Default` implementation
enum_variants::STUTTER,
if_not_else::IF_NOT_ELSE,
items_after_statements::ITEMS_AFTER_STATEMENTS,
+ loops::NEVER_LOOP,
matches::SINGLE_MATCH_ELSE,
mem_forget::MEM_FORGET,
methods::FILTER_MAP,
loops::FOR_LOOP_OVER_RESULT,
loops::ITER_NEXT_LOOP,
loops::NEEDLESS_RANGE_LOOP,
- loops::NEVER_LOOP,
loops::REVERSE_RANGE_LOOP,
loops::UNUSED_COLLECT,
loops::WHILE_LET_LOOP,
"looping on a map using `iter` when `keys` or `values` would do"
}
-/// **What it does:** Checks for loops that contain an unconditional `break`.
+/// **What it does:** Checks for loops that contain an unconditional `break`
+/// or `return`.
///
/// **Why is this bad?** This loop never loops, all it does is obfuscating the
/// code.
///
-/// **Known problems:** None.
+/// **Known problems:** Ignores `continue` statements in the loop that create
+/// nontrivial control flow. Therefore set to `Allow` by default.
+/// See https://github.com/Manishearth/rust-clippy/issues/1586
///
/// **Example:**
/// ```rust
/// ```
declare_lint! {
pub NEVER_LOOP,
- Warn,
- "any loop with an unconditional `break` statement"
+ Allow,
+ "any loop with an unconditional `break` or `return` statement"
}
#[derive(Copy, Clone)]