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.