* master: (58 commits)
Rustfmt all the things
Don't make decisions on values that don't represent the decision
Improving comments.
Rustup
Added rustfix to the test.
Improve span shortening.
Added "make_return" and "blockify" convenience methods in Sugg and used them in "needless_bool".
Actually check for constants.
Fixed potential mistakes with nesting. Added tests.
formatting fix
Update clippy_lints/src/needless_bool.rs
formatting fix
Fixing typo in CONTRIBUTING.md
Fix breakage due to rust-lang/rust#57651
needless bool lint suggestion is wrapped in brackets if it is an "else" clause of an "if-else" statement
Fix automatic suggestion on `use_self`.
Remove negative integer literal checks.
Fix `implicit_return` false positives.
Run rustfmt
Fixed breakage due to rust-lang/rust#57489
...
Before, when you had a block comment between an attribute and the
following item like this:
```rust
\#[crate_type = "lib"]
/*
*/
pub struct Rust;
```
It would cause a false positive on the lint, because there is an empty
line inside the block comment.
This makes sure that basic block comments are detected and removed from
the snippet that was created before.
`empty_line_after_outer_attribute` produced a false positive warning when
deriving `Copy` and/or `Clone` for an item.
It looks like the second point in [this comment][that_comment] is related,
as the attribute that causes the false positive has a path of
`rustc_copy_clone_marker`.
Fixes#2475
[that_comment]: https://github.com/rust-lang/rust/issues/35900#issuecomment-245978831
This makes it so that the `empty_line_after_outer_attribute` lint only
checks for newlines between the end of the attribute and the beginning
of the following item.
We need to check for the empty line count being bigger than 2 because
now the snippet of valid code contains only `\n` and splitting it
produces `["", ""]`
Invalid code will contain more than 2 empty strings.
Doc comments are syntactic sugar for #[doc] attributes, so this lint was
catching them, too.
This commit makes it so that doc comments are ignored in this lint.
I think, for normal attributes it makes sense to warn about following empty
lines, for doc comments, less. This way the user has some freedom over
the formatting.