dtolnay / async-trait

Type erasure for async trait methods
Apache License 2.0
1.81k stars 84 forks source link

Weird issue with clippy and async attribute #94

Closed Freyskeyd closed 4 years ago

Freyskeyd commented 4 years ago

Hello!

First thank's for this amazing work on this crate. I think I found a little issue with async-trait and clippy.

When running clippy on a project I see this error:

error: Found an empty line after an outer attribute. Perhaps you forgot to add a `!` to make it an inner attribute?
  --> src/lib.rs:19:5
   |
19 |     async fn fetch_user_feed(&self, _user_id: &str) -> Result<(), ClientError> {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> src/lib.rs:2:9
   |
2  | #![deny(clippy::nursery)]
   |         ^^^^^^^^^^^^^^^
   = note: `#[deny(clippy::empty_line_after_outer_attr)]` implied by `#[deny(clippy::nursery)]`
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_outer_attr

I digged into a lot of refactoring and exploration to find what's going on but I feel like I'm missing something. After asking for help on discord they told me to create an issue because it's maybe relative to the async-trait crate instead of my code. I did a replication of the issue on this repository if you want to take a look : https://github.com/Freyskeyd/async-trait-bug

Thank's for reading!

dtolnay commented 4 years ago

This is a Clippy bug. Closing in favor of https://github.com/rust-lang/rust-clippy/issues/5567.

Please cross-link when filing multiple issues about the same bug.

Freyskeyd commented 4 years ago

sorry I created the clippy one after this one. I was thinking it was more related to async-trait but no.