Skip to content
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

cannot build on latest nightly: get_task_context not found #30

Closed
gauteh opened this issue Nov 24, 2019 · 1 comment · Fixed by #31
Closed

cannot build on latest nightly: get_task_context not found #30

gauteh opened this issue Nov 24, 2019 · 1 comment · Fixed by #31
Labels
C-bug Category: related to a bug.

Comments

@gauteh
Copy link

gauteh commented Nov 24, 2019

Hi, I am trying to use this in combination with hyper. But first just trying to build this repository alone. I ran rustup update, and I have:

❯ rustup show
Default host: x86_64-apple-darwin

installed targets for active toolchain
--------------------------------------

wasm32-unknown-unknown
x86_64-apple-darwin

active toolchain
----------------

nightly-x86_64-apple-darwin (default)
rustc 1.41.0-nightly (0c987c5c0 2019-11-23)

when I try to cargo build this crate, I get:


   Compiling futures-async-stream v0.1.1 (/Users/gauteh/dev/futures-async-stream)
error[E0425]: cannot find function `get_task_context` in module `future`
  --> src/stream.rs:59:13
   |
59 |     future::get_task_context(|cx| S::poll_next(s, cx))
   |             ^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `set_task_context`

error[E0425]: cannot find function `get_task_context` in module `future`
  --> src/stream.rs:71:13
   |
71 |     future::get_task_context(|cx| F::poll(f, cx))
   |             ^^^^^^^^^^^^^^^^ help: a function with a similar name exists: `set_task_context`

error[E0603]: function `set_task_context` is private
  --> src/stream.rs:43:17
   |
43 |         future::set_task_context(cx, || match this.gen.resume() {
   |                 ^^^^^^^^^^^^^^^^

error[E0603]: function `set_task_context` is private
  --> src/try_stream.rs:49:27
   |
49 |         let res = future::set_task_context(cx, || match this.gen.as_mut().resume() {
   |                           ^^^^^^^^^^^^^^^^

error[E0061]: this function takes 1 parameter but 2 parameters were supplied
  --> src/stream.rs:43:9
   |
43 | /         future::set_task_context(cx, || match this.gen.resume() {
44 | |             GeneratorState::Yielded(x) => x.map(Some),
45 | |             GeneratorState::Complete(()) => Poll::Ready(None),
46 | |         })
   | |__________^ expected 1 parameter

error[E0308]: mismatched types
  --> src/stream.rs:43:9
   |
41 |       fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
   |                                                                   ------------------------ expected `std::task::Poll<std::option::Option<T>>` because of return type
42 |           let this = self.project();
43 | /         future::set_task_context(cx, || match this.gen.resume() {
44 | |             GeneratorState::Yielded(x) => x.map(Some),
45 | |             GeneratorState::Complete(()) => Poll::Ready(None),
46 | |         })
   | |__________^ expected enum `std::task::Poll`, found struct `std::future::SetOnDrop`
   |
   = note: expected enum `std::task::Poll<std::option::Option<T>>`
            found struct `std::future::SetOnDrop`

error[E0061]: this function takes 1 parameter but 2 parameters were supplied
  --> src/try_stream.rs:49:19
   |
49 |           let res = future::set_task_context(cx, || match this.gen.as_mut().resume() {
   |  ___________________^
50 | |             GeneratorState::Yielded(x) => x.map(|x| Some(Ok(x))),
51 | |             GeneratorState::Complete(Err(e)) => Poll::Ready(Some(Err(e))),
52 | |             GeneratorState::Complete(Ok(())) => Poll::Ready(None),
53 | |         });
   | |__________^ expected 1 parameter

error[E0308]: mismatched types
  --> src/try_stream.rs:54:16
   |
54 |         if let Poll::Ready(Some(Err(_))) | Poll::Ready(None) = &res {
   |                ^^^^^^^^^^^^^^^^^^^^^^^^^                       ---- this match expression has type `std::future::SetOnDrop`
   |                |
   |                expected struct `std::future::SetOnDrop`, found enum `std::task::Poll`
   |
   = note: expected struct `std::future::SetOnDrop`
                found enum `std::task::Poll<_>`

error[E0308]: mismatched types
  --> src/try_stream.rs:54:44
   |
54 |         if let Poll::Ready(Some(Err(_))) | Poll::Ready(None) = &res {
   |                                            ^^^^^^^^^^^^^^^^^   ---- this match expression has type `std::future::SetOnDrop`
   |                                            |
   |                                            expected struct `std::future::SetOnDrop`, found enum `std::task::Poll`
   |
   = note: expected struct `std::future::SetOnDrop`
                found enum `std::task::Poll<_>`

error[E0308]: mismatched types
  --> src/try_stream.rs:57:9
   |
43 |     fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
   |                                                                 ------------------------ expected `std::task::Poll<std::option::Option<std::result::Result<T, E>>>` because of return type
...
57 |         res
   |         ^^^ expected enum `std::task::Poll`, found struct `std::future::SetOnDrop`
   |
   = note: expected enum `std::task::Poll<std::option::Option<std::result::Result<T, E>>>`
            found struct `std::future::SetOnDrop`

error: aborting due to 10 previous errors

Some errors have detailed explanations: E0061, E0308, E0425, E0603.
For more information about an error, try `rustc --explain E0061`.
error: could not compile `futures-async-stream`.

```
Seeker14491 added a commit to Seeker14491/steamworks-rs that referenced this issue Dec 7, 2019
We previously used the `futures-async-stream` crate, which broke a few weeks ago on nightly: taiki-e/futures-async-stream#30. We now use the `genawaiter` crate, which also works on stable Rust. Given that async/await has become stable, I went ahead and made this crate work on stable Rust now.
@bors bors bot closed this as completed in 7f58a9e Dec 10, 2019
@taiki-e
Copy link
Owner

taiki-e commented Dec 10, 2019

Published 0.1.2 which fixes this issue.

@taiki-e taiki-e added the C-bug Category: related to a bug. label May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: related to a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants