I don't know if this issue should be here or in rust issues, but it does occur with this library.
Versions
name
version
rust
1.78.0
async-trait
0.1.80
tokio
1.37.0
Description
If we create a trait that has an asynchronous function with immutable reference to itself and try to mutate it we may get an incorrect (as i know) rust code help hint:
help: consider specifying this binding's type
|
15 | async fn non_mutable_fn(&self: &mut TestStruct, new: i32) {
| +++++++++++++++++
I don't know if this issue should be here or in rust issues, but it does occur with this library.
Versions
Description
If we create a trait that has an asynchronous function with immutable reference to itself and try to mutate it we may get an incorrect (as i know) rust code help hint:
Full code on rust-playground.com
Or here
```rust use async_trait::async_trait; // 0.1.80 use tokio; // 1.37.0 #[async_trait] trait First { async fn non_mutable_fn(&self, new: i32); } struct TestStruct { nums: VecExpected behavior
Standard help about mutable reference, without the
async-trait
crate you can achieve that: