Closed NobodyXu closed 1 year ago
Minimized:
use async_trait::async_trait;
#[async_trait]
pub trait Trait {
async fn f(&mut self);
}
#[async_trait]
impl Trait for bool {
async fn f(&mut self) {
let true = self else { return };
}
}
error[E0382]: use of moved value: `self`
--> src/main.rs:11:13
|
10 | async fn f(&mut self) {
| ---- value moved here
11 | let true = self else { return };
| ^^^^ value used here after move
|
= note: move occurs because `self` has type `&mut bool`, which does not implement the `Copy` trait
This is fixed in async-trait 0.1.67.
I encountered the following error in this file when running
cargo b
:Turns out that this is a bug in
async_trait
codegen with let-else: