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 on empty_line_after_outer_attr #2517

Closed
topecongiro opened this issue Mar 8, 2018 · 3 comments
Closed

False positive on empty_line_after_outer_attr #2517

topecongiro opened this issue Mar 8, 2018 · 3 comments
Labels
C-bug Category: Clippy is not doing the correct thing T-macros Type: Issues with macros and macro expansion

Comments

@topecongiro
Copy link
Contributor

When you run cargo clippy against the following code,

#[must_use]
#[derive(Debug, Default, Clone, Copy)]
pub struct Summary {
    // Encountered e.g. an IO error.
    has_operational_errors: bool,

    // Failed to reformat code because of parsing errors.
    has_parsing_errors: bool,

    // Code is valid, but it is impossible to format it properly.
    has_formatting_errors: bool,

    // Formatted code differs from existing code (write-mode diff only).
    pub has_diff: bool,
}

you will get the following warning:

warning: Found an empty line after an outer attribute. Perhaps you forgot to add a '!' to make it an inner attribute?
 --> src/lib.rs:3:1
  |
3 | pub struct Summary {
  | ^
  |
  = 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.187/index.html#empty_line_after_outer_attr

Using 0.0.187.

@oli-obk
Copy link
Contributor

oli-obk commented Mar 8, 2018

cc @phansch

@oli-obk oli-obk added the C-bug Category: Clippy is not doing the correct thing label Mar 8, 2018
@phansch
Copy link
Member

phansch commented Mar 28, 2018

Looks like the automatic close didn't work on this one. This was fixed by #2577 and is in 0.0.190

@phansch phansch closed this as completed Mar 28, 2018
@topecongiro
Copy link
Contributor Author

@phansch Thanks for your work! FWIW you need to write the verb before every issue number, like Fixes #2475. Fixes #2517. to make automatic closing work.

@phansch phansch added the T-macros Type: Issues with macros and macro expansion label Apr 4, 2018
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