]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #3555 - daxpedda:master, r=oli-obk
authorbors <bors@rust-lang.org>
Mon, 17 Dec 2018 10:48:16 +0000 (10:48 +0000)
committerbors <bors@rust-lang.org>
Mon, 17 Dec 2018 10:48:16 +0000 (10:48 +0000)
Fix `implicit_return` false positives.

Fixing some false positives on the `implicit_return` lint.

Basically it should only check for missing return statements in `block.stmts.last()` if it's a `break`, otherwise it should skip because it would either be an error, or a false positive in the case of a `loop` (which I'm trying to fix with this PR).

**Question:**
- I say "we" inside of comments ([`// make sure it's a break, otherwise we want to skip`](https://github.com/rust-lang/rust-clippy/pull/3555/files#diff-11d233fe8c8414214c2b8732b8c9877aR71)). Any alternatives or is that okay?
- I named a test [`test_loop_with_nests()`](https://github.com/rust-lang/rust-clippy/blob/6870638c3fb66c2abb20633bf40cc09ccc760047/tests/ui/implicit_return.rs#L54-L64), any better suggestions?


Trivial merge