use async_trait::async_trait;
#[async_trait]
pub trait Trait {
async fn handle(&self);
}
pub enum Enum {
Variant,
}
#[async_trait]
impl Trait for Enum {
async fn handle(&self) {
let Enum::Variant = self; // works
let Self::Variant = self; // does not work
}
}
error[E0401]: can't use generic parameters from outer function
--> tests/test.rs:552:17
|
549 | impl Trait for Enum {
| ---- `Self` type implicitly declared here, by this `impl`
...
552 | let Self::Variant = self;
| ^^^^^^^^^^^^^
| |
| use of generic parameter from outer function
| use a type here instead