Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive: empty_line_after_outer_attr 3+ empty lines enum #2475

Closed
alexheretic opened this issue Feb 22, 2018 · 2 comments
Closed

False positive: empty_line_after_outer_attr 3+ empty lines enum #2475

alexheretic opened this issue Feb 22, 2018 · 2 comments
Labels
C-bug Category: Clippy is not doing the correct thing T-macros Type: Issues with macros and macro expansion

Comments

@alexheretic
Copy link
Member

Using 5e6342d empty_line_after_outer_attr warnings appear when a simple enum has 3+ empty lines. Doesn't occur with 1 or 2 empty lines.

#[derive(Clone, Copy)]
pub enum Foo {
    Bar1,

    Bar2,

    Bar3,

    Bar4,
}
warning: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
 --> src/main.rs:2:1
  |
2 | pub enum Foo {
  | ^
  |
  = note: #[warn(empty_line_after_outer_attr)] on by default
  = help: for further information visit https://rust-lang-nursery.github.io/rust-clippy/v0.0.186/index.html#empty_line_after_outer_attr
@oli-obk oli-obk added the C-bug Category: Clippy is not doing the correct thing label Feb 22, 2018
@oli-obk
Copy link
Contributor

oli-obk commented Feb 22, 2018

cc @phansch

@phansch
Copy link
Member

phansch commented Feb 23, 2018

Thanks, I will take a look later today!

quodlibetor added a commit to quodlibetor/rust-chrono that referenced this issue Mar 4, 2018
rust-lang/rust-clippy#2475 , we'll revert this commit when that's
fixed.
phansch added a commit to phansch/rust-clippy that referenced this issue Mar 26, 2018
`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 rust-lang#2475

[that_comment]: rust-lang/rust#35900 (comment)
@phansch phansch added the T-macros Type: Issues with macros and macro expansion label Apr 4, 2018
Jarcho added a commit to Jarcho/rust-clippy that referenced this issue May 5, 2022
Jarcho added a commit to Jarcho/rust-clippy that referenced this issue May 5, 2022
bors added a commit that referenced this issue May 5, 2022
Lint `empty_lint_after_outer_attr` on argumentless macros

Reverts the change from 034c81b as it's no longer needed. The test is left just in case. Original issue is #2475.

changelog: Lint `empty_lint_after_outer_attr` on argumentless macros again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing T-macros Type: Issues with macros and macro expansion
Projects
None yet
Development

No branches or pull requests

3 participants