dtolnay / async-trait

Type erasure for async trait methods
Apache License 2.0
1.84k stars 85 forks source link

0.1.47 release causes issues with clippy::items_after_statements lint #154

Closed tyranron closed 3 years ago

tyranron commented 3 years ago

When I use something like:

#[async_trait]
impl MyTrait for Foo {
    async fn my_trait(&self) {
        const MAX: u16 = 128;
        // ...
    }

    async fn or_with_use(&self) {
        use MyError as E;
        // ...
    }
}

clippy::items_after_statements now complains.

Seems that the generated code has changed in the way that top-level use/const statements are not top-level anymore in sthe expanded code.

dtolnay commented 3 years ago

Fixed in 0.1.48.