-
Notifications
You must be signed in to change notification settings - Fork 13.3k
from_generator::GenFuture<[static generator@...]> in Error Message #99310
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
Comments
Prior art: let mut x = 0;
let f = || x += 1;
let y = &f as &dyn Fn(); I believe this used to generate a similar error (including a name for the anon closure type), but now the error is
See: #26046 |
Unfortunately auto traits break this rule, since they intentionally "leak" through opaque types 😅 |
Looking back on this. I think we can get some special casing: UnpinCurrently, all generators/futures are Send/SyncA case where people may want nice error messages is in the case that a future is not send. It seems we already have this though, which is nice: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1d6836aec8c69c3171af54252f71d322
|
Seems that there is no longer I wonder how futures get lowered now anyway. |
Futures are lowered as coroutines whose CoroutineKind specifies that they implement Future directly |
Given the following code: (playground link)
The current output is:
Given that the docs for
from_generator
are explicitly hidden to help with error messages, I would expect this error to not make reference to a hidden item.rust/library/core/src/future/mod.rs
Lines 62 to 74 in e6c43cf
The text was updated successfully, but these errors were encountered: