-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
expected signature of `for<'r, 's> fn(&'r mut std::task::Context<'s>) #58639
Comments
This is typical closure inference not inferring a for<'a> when being assigned to a variable rather than being directly passed to a function. |
You are right. This one worked: - let poll_next = |waker: &_| Pin::new(&mut *stream).poll_next(waker);
- let future_next = poll_fn(poll_next);
+ let future_next = poll_fn(|waker| Pin::new(&mut *stream).poll_next(waker)); Still is it a bug or a normal behavior? |
I'd say it's at most "feature request", and I'm sure there's an issue in here since around 1.0 for it :P |
Er, I'm going to close this issue, since it's (at least at present) expected behavior, and it's also not particularly related to async-await. |
Futures API moved from
With error:
This one does not help either: - let read_line = |_context| -> Poll<String> {
+ let read_line = |_context: &mut _| -> Poll<String> { So I have to explicitly set the type of the arg: - let read_line = |_context| -> Poll<String> {
+ let read_line = |_context: &mut Context| -> Poll<String> {
Is it an expected behavior? |
MRE:
futures-preview =
=0.3.0-alpha.13
rustc -vV =
1.34.0-nightly (146aa60f3 2019-02-18) x86_64-unknown-linux-gnu LLVM 8.0
Local fix:
Is it a bug?
The text was updated successfully, but these errors were encountered: