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

Error building Applied: HTTP Server example #5

Closed
ivstas opened this issue Jan 3, 2019 · 4 comments
Closed

Error building Applied: HTTP Server example #5

ivstas opened this issue Jan 3, 2019 · 4 comments

Comments

@ivstas
Copy link

ivstas commented Jan 3, 2019

Not sure it is correct to open this issue, since this book is probably WIP, but I got stuck with this:
I'm trying to get through Applied: HTTP Server tutorial, and I'm getting an error when trying to build very first version of a server (If you cargo run now part of the tutorial).

I've tried this on 2 different PCs, both on Windows 10. My latest laptop have this versions:

C:\Users\stasd\code\async-await-echo>rustc --version
rustc 1.33.0-nightly (ec194646f 2019-01-02)
C:\Users\stasd\code\async-await-echo>cargo --version
cargo 1.33.0-nightly (0d1f1bbea 2018-12-19)

And I'm getting an error while running cargo run:

C:\Users\stasd\code\async-await-echo>cargo run
    Updating crates.io index
  Downloaded tokio v0.1.13
  Downloaded hyper v0.12.19
  Downloaded bytes v0.4.11
  Downloaded num_cpus v1.9.0
  Downloaded tokio-reactor v0.1.7
  Downloaded tokio-fs v0.1.4
  Downloaded tokio-threadpool v0.1.9
  Downloaded futures-preview v0.3.0-alpha.11
  Downloaded cfg-if v0.1.6
  Downloaded log v0.4.6
  Downloaded tokio-io v0.1.10
  Downloaded tokio-current-thread v0.1.4
  Downloaded tokio-timer v0.2.8
  Downloaded tokio-udp v0.1.3
  Downloaded lazycell v1.2.1
  Downloaded byteorder v1.2.7
  Downloaded tokio-async-await v0.1.4
  Downloaded crossbeam-utils v0.6.3
  Downloaded rand v0.6.1
  Downloaded lock_api v0.1.5
  Downloaded http v0.1.14
  Downloaded futures-channel-preview v0.3.0-alpha.11
  Downloaded h2 v0.1.14
  Downloaded smallvec v0.6.7
  Downloaded time v0.1.41
  Downloaded futures-executor-preview v0.3.0-alpha.11
  Downloaded lazy_static v1.2.0
  Downloaded futures-io-preview v0.3.0-alpha.11
  Downloaded crossbeam-deque v0.6.3
  Downloaded futures-core-preview v0.3.0-alpha.11
  Downloaded rand_isaac v0.1.1
  Downloaded rand_hc v0.1.0
  Downloaded futures-util-preview v0.3.0-alpha.11
  Downloaded rand_xorshift v0.1.0
  Downloaded owning_ref v0.4.0
  Downloaded libc v0.2.46
  Downloaded rand_pcg v0.1.1
  Downloaded crossbeam-epoch v0.7.0
  Downloaded indexmap v1.0.2
  Downloaded string v0.1.2
  Downloaded pin-utils v0.1.0-alpha.4
  Downloaded futures-sink-preview v0.3.0-alpha.11
  Downloaded rand_chacha v0.1.0
  Downloaded proc-macro-hack v0.5.4
  Downloaded arrayvec v0.4.10
  Downloaded syn v0.15.23
  Downloaded proc-macro2 v0.4.24
  Downloaded quote v0.6.10
  Downloaded nodrop v0.1.13
  Downloaded futures-select-macro-preview v0.3.0-alpha.11
   Compiling semver-parser v0.7.0
   Compiling proc-macro2 v0.4.24
   Compiling winapi v0.3.6
   Compiling winapi-build v0.1.1
   Compiling rand_core v0.3.0
   Compiling unicode-xid v0.1.0
   Compiling arrayvec v0.4.10
   Compiling void v1.0.2
   Compiling nodrop v0.1.13
   Compiling cfg-if v0.1.6
   Compiling winapi v0.2.8
   Compiling libc v0.2.46
   Compiling stable_deref_trait v1.1.1
   Compiling lazy_static v1.2.0
   Compiling either v1.5.0
   Compiling memoffset v0.2.1
   Compiling byteorder v1.2.7
   Compiling scopeguard v0.3.3
   Compiling futures v0.1.25
   Compiling lazycell v1.2.1
   Compiling slab v0.4.1
   Compiling fnv v1.0.6
   Compiling pin-utils v0.1.0-alpha.4
   Compiling httparse v1.3.3
   Compiling itoa v0.4.3
   Compiling indexmap v1.0.2
   Compiling try-lock v0.2.2
   Compiling string v0.1.2
   Compiling unreachable v1.0.0
   Compiling ws2_32-sys v0.2.1
   Compiling kernel32-sys v0.2.2
   Compiling crossbeam-utils v0.6.3
   Compiling log v0.4.6
   Compiling rand_core v0.2.2
   Compiling rand_isaac v0.1.1
   Compiling rand_hc v0.1.0
   Compiling rand_xorshift v0.1.0
   Compiling semver v0.9.0
   Compiling owning_ref v0.4.0
   Compiling futures-core-preview v0.3.0-alpha.11
   Compiling smallvec v0.6.7
   Compiling lock_api v0.1.5
   Compiling futures-channel-preview v0.3.0-alpha.11
   Compiling rustc_version v0.2.3
   Compiling num_cpus v1.9.0
   Compiling crossbeam-epoch v0.7.0
   Compiling futures-sink-preview v0.3.0-alpha.11
   Compiling rand_chacha v0.1.0
   Compiling parking_lot_core v0.3.1
   Compiling rand_pcg v0.1.1
   Compiling rand v0.6.1
   Compiling quote v0.6.10
   Compiling tokio-executor v0.1.5
   Compiling futures-cpupool v0.1.8
   Compiling want v0.0.6
   Compiling crossbeam-deque v0.6.3
   Compiling syn v0.15.23
   Compiling tokio-timer v0.2.8
   Compiling tokio-current-thread v0.1.4
   Compiling net2 v0.2.33
   Compiling rand v0.5.5
   Compiling time v0.1.41
   Compiling tokio-threadpool v0.1.9
   Compiling parking_lot v0.6.4
   Compiling proc-macro-hack v0.5.4
   Compiling futures-select-macro-preview v0.3.0-alpha.11
   Compiling iovec v0.1.2
   Compiling miow v0.2.1
   Compiling bytes v0.4.11
   Compiling futures-io-preview v0.3.0-alpha.11
   Compiling futures-util-preview v0.3.0-alpha.11
   Compiling tokio-io v0.1.10
   Compiling http v0.1.14
   Compiling mio v0.6.16
   Compiling tokio-codec v0.1.1
   Compiling tokio-async-await v0.1.4
   Compiling tokio-fs v0.1.4
error[E0599]: no function or associated item named `pinned` found for type `std::boxed::Box<_>` in the current scope
  --> C:\Users\stasd\.cargo\registry\src\github.com-1ecc6299db9ec823\tokio-async-await-0.1.4\src\compat\backward.rs:22:21
   |
22 |         Compat(Box::pinned(future))
   |                -----^^^^^^
   |                |
   |                function or associated item not found in `std::boxed::Box<_>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0599`.
error: Could not compile `tokio-async-await`.
warning: build failed, waiting for other jobs to finish...
error: build failed
@balthild
Copy link

This issue has been fixed: tokio-rs/tokio#813

@weiby3
Copy link

weiby3 commented Feb 23, 2019

I got a similar problem. Same code as this issue.
OS: centos7

[weiby@login async_server]$ cargo --version
cargo 1.34.0-nightly (b33ce7fc9 2019-02-19)
[weiby@login async_server]$ rustc --version
rustc 1.34.0-nightly (e1c6d0057 2019-02-22)

cargo check output:

[weiby@login async_server]$ cargo run
    Updating `git://mirrors.ustc.edu.cn/crates.io-index` index
   Compiling semver-parser v0.7.0
   Compiling autocfg v0.1.2
   Compiling libc v0.2.49
   Compiling rand_core v0.4.0
   Compiling arrayvec v0.4.10
   Compiling proc-macro2 v0.4.27
   Compiling unicode-xid v0.1.0
   Compiling lazy_static v1.2.0
   Compiling byteorder v1.3.1
   Compiling stable_deref_trait v1.1.1
   Compiling cfg-if v0.1.6
   Compiling nodrop v0.1.13
   Compiling smallvec v0.6.9
   Compiling memoffset v0.2.1
   Compiling scopeguard v0.3.3
   Compiling either v1.5.1
   Compiling slab v0.4.2
   Compiling futures v0.1.25
   Compiling lazycell v1.2.1
   Compiling proc-macro-nested v0.1.2
   Compiling httparse v1.3.3
   Compiling pin-utils v0.1.0-alpha.4
   Compiling itoa v0.4.3
   Compiling fnv v1.0.6
   Compiling string v0.1.3
   Compiling indexmap v1.0.2
   Compiling try-lock v0.2.2
   Compiling log v0.4.6
   Compiling owning_ref v0.4.0
   Compiling crossbeam-utils v0.6.5
   Compiling futures-core-preview v0.3.0-alpha.12
   Compiling lock_api v0.1.5
error[E0432]: unresolved import `core::task::LocalWaker`
 --> /share/home/weiby/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/futures-core-preview-0.3.0-alpha.12/src/future/future_obj.rs:6:12
  |
6 |     task::{LocalWaker, Poll},
  |            ^^^^^^^^^^ no `LocalWaker` in `task`

error[E0432]: unresolved imports `core::task::LocalWaker`, `core::task::UnsafeWake`
 --> /share/home/weiby/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/futures-core-preview-0.3.0-alpha.12/src/task/mod.rs:8:35
  |
8 | pub use core::task::{Poll, Waker, LocalWaker, UnsafeWake};
  |                                   ^^^^^^^^^^  ^^^^^^^^^^ no `UnsafeWake` in `task`
  |                                   |
  |                                   no `LocalWaker` in `task`

error[E0432]: unresolved imports `std::task::Wake`, `std::task::local_waker`, `std::task::local_waker_from_nonlocal`
  --> /share/home/weiby/.cargo/registry/src/mirrors.ustc.edu.cn-61ef6e0cd06fb9b8/futures-core-preview-0.3.0-alpha.12/src/task/mod.rs:10:21
   |
10 | pub use std::task::{Wake, local_waker, local_waker_from_nonlocal};
   |                     ^^^^  ^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^^^^ no `local_waker_from_nonlocal` in `task`
   |                     |     |
   |                     |     no `local_waker` in `task`
   |                     no `Wake` in `task`. Did you mean to use `Waker`?

   Compiling rand_core v0.3.1
   Compiling rand_jitter v0.1.3
   Compiling rand_xorshift v0.1.1
   Compiling rand_isaac v0.1.1
   Compiling rand_hc v0.1.0
error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `futures-core-preview`.
warning: build failed, waiting for other jobs to finish...
error: build failed

@weiby3
Copy link

weiby3 commented Feb 23, 2019

From this issue, it seems that the code in the async book should be updated.

@cramertj
Copy link
Member

Fixed by #18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants