-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
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
Using the format!() macro with an async function makes the whole Future non-Send #101650
Comments
Notes:
I'll guess this is |
Fix get_connectivity_html and get_encrinfo futures not being Send. See rust-lang/rust#101650 for more information. Co-authored-by: jikstra <[email protected]>
Fix get_connectivity_html and get_encrinfo futures not being Send. See rust-lang/rust#101650 for more information. Co-authored-by: jikstra <[email protected]>
* add more functions, see changelog for details * add pr number to changelog * clarify doc comment * clarify usage of BasicChat and adjust properties acordingly r10s is right it should only contain what we need of the expensive calls * fix doc typos * run cargo fmt * jsonrpc: add connectivity functions * fix typo * fix typo * Add get_contact_encryption_info and get_connectivity_html Fix get_connectivity_html and get_encrinfo futures not being Send. See rust-lang/rust#101650 for more information. Co-authored-by: jikstra <[email protected]> * Update CHANGELOG * Update typescript files * remove todo from changelog Co-authored-by: jikstra <[email protected]>
Maybe, maybe not. At the very least I think we should prevent this from accidentally starting to work as that would prevent ever returning to the old code even if the new code is found to have severe issues. |
This isn't a "bug", in the sense that this behaviour is as expected. However, that doesn't mean that we shouldn't consider changing the behaviour. The problem is that #99012 could indeed fix it, but as @bjorn3 mentions, we should be careful not to accidentally make something new work without first considering whether we want to commit to the new behaviour. |
I tried this code: (minimal reproducible example; for the actual code see deltachat/deltachat-core-rust#3591)
Playground
Note that we are using,
in a context where the Future needs to be
Send
; only this line without thestring_builder
seems not to be able to reproduce the issue though.I expected to see this happen: That the code behaves the same as
Instead, this happened:
There are two error messages (about line 5 and line 7); this issue is about the first one:
The second error message didn't appear in the original issue in deltachat/deltachat-core-rust#3591, possibly because there the call to
Box::pin()
and theformat!()
call are in two different crates:Meta
rustc --version --verbose
Probably doesn't matter, anyway:
@rustbot label +A-fmt
The text was updated successfully, but these errors were encountered: