We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried this code godbolt:
#![feature(async_fn_in_trait)] pub trait Bar: Foo { async fn bar(&mut self) -> Result<(), ()>; } pub trait Foo { async fn foo(&mut self) -> Result<(), ()>; } impl<B: Bar> Foo for B { async fn foo(&mut self) -> Result<(), ()> { self.bar().await } }
I expected to see this happen: my code compiles (as it does without AFIT), or the compiler tells me something useful.
Instead, this happened: rustc gave me a very confusing error:
error[E0053]: method `foo` has an incompatible type for trait --> <source>:12:32 | 12 | async fn foo(&mut self) -> Result<(), ()> { | ^^^^^^^^^^^^^^ expected associated type, found future | note: type in trait --> <source>:8:32 | 8 | async fn foo(&mut self) -> Result<(), ()>; | ^^^^^^^^^^^^^^ = note: expected signature `fn(&mut B) -> impl Future<Output = Result<(), ()>>` found signature `fn(&mut B) -> impl Future<Output = Result<(), ()>>`
rustc --version --verbose:
rustc --version --verbose
rustc 1.72.0-nightly (371994e0d 2023-06-13)
The text was updated successfully, but these errors were encountered:
Duplicate of #112626
Sorry, something went wrong.
No branches or pull requests
I tried this code godbolt:
I expected to see this happen: my code compiles (as it does without AFIT), or the compiler tells me something useful.
Instead, this happened: rustc gave me a very confusing error:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: