dtolnay / async-trait

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

Use parentheses to disambiguate impl Trait #204

Closed dtolnay closed 2 years ago

dtolnay commented 2 years ago
use async_trait::async_trait;

#[async_trait]
pub trait Trait {
    async fn f(arg: &impl Trait);
}

currently fails with:

error: ambiguous `+` in a type
 --> src/main.rs:5:22
  |
5 |     async fn f(arg: &impl Trait);
  |                      ^^^^^^^^^^ help: use parentheses to disambiguate: `(impl 'async_trait + Trait)`