Confusing error message on variables created on the fly and passed to an async fn #66440
Labels
A-async-await
Area: Async & Await
A-diagnostics
Area: Messages for errors, warnings, and lints
D-confusing
Diagnostics: Confusing error or lint that should be reworked.
E-needs-mcve
Call for participation: This issue has a repro, but needs a Minimal Complete and Verifiable Example
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Hello,
when passing variables created on the fly to async functions, I get a really confusing error like that:
You can replicate this error by compiling my project https://github.com/nappa85/Pokifications/tree/mysql_async, editing file https://github.com/nappa85/Pokifications/blob/mysql_async/src/bot/message.rs on line 106, putting the query String directly on the query method, like that:
Creating the String and then passing it to the method, it works:
I'm aware that this is a complex case, probably given by the a combination of elements, between the others the async_trait crate.
In facts I haven't been able to replicate the problem on a code snippet, probably because I haven't reached the level of complexity my project has.
I'm available for any clarification or test.
The text was updated successfully, but these errors were encountered: