smol-rs / smol

A small and fast async runtime for Rust
Apache License 2.0
3.74k stars 157 forks source link

error: `core::slice::<impl [T]>::len` is not yet stable as a const fn #163

Closed dazzag24 closed 4 years ago

dazzag24 commented 4 years ago

I installed rust this morning with:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

This installed these versions:

darreng@DazXPS:~/code/rust/smol/examples$ rustc --version
rustc 1.38.0 (625451e37 2019-09-23)
darreng@DazXPS:~/code/rust/smol/examples$ cargo --version
cargo 1.38.0 (23ef9a4ef 2019-08-20)

Clone smol and attempt to run an example:

darreng@DazXPS:~/code/rust$ git clone https://github.com/stjepang/smol.git
Cloning into 'smol'...
remote: Enumerating objects: 2068, done.
remote: Total 2068 (delta 0), reused 0 (delta 0), pack-reused 2068
Receiving objects: 100% (2068/2068), 530.87 KiB | 1.13 MiB/s, done.
Resolving deltas: 100% (1311/1311), done.
darreng@DazXPS:~/code/rust$ cd smol/
darreng@DazXPS:~/code/rust/smol$ cd examples/
darreng@DazXPS:~/code/rust/smol/examples$ cargo run --example ctrl-c
    Updating crates.io index
  Downloaded ctrlc v3.1.4
  Downloaded tokio-io v0.1.13
  Downloaded surf v2.0.0-alpha.4
  Downloaded url v2.1.1
  Downloaded fnv v1.0.7
  Downloaded native-tls v0.2.4
  Downloaded hyper v0.13.6
  Downloaded signal-hook v0.1.15
  Downloaded reqwest v0.10.6
  Downloaded async-std v1.6.1
  Downloaded http v0.2.1
  Downloaded mio v0.6.22
  Downloaded tungstenite v0.10.1
  Downloaded base64 v0.12.1
  Downloaded rand v0.7.3
  Downloaded nix v0.17.0
  Downloaded timerfd v1.1.1
  Downloaded async-native-tls v0.3.3
  Downloaded http-types v1.3.1
  Downloaded scraper v0.11.0
  Downloaded inotify v0.8.3
  Downloaded async-tungstenite v0.4.2
  Downloaded async-h1 v1.1.2
  Downloaded openssl-sys v0.9.58
  Downloaded bytes v0.4.12
  Downloaded httparse v1.3.4
  Downloaded infer v0.1.6
  Downloaded openssl v0.10.29
  Downloaded tower-service v0.3.0
  Downloaded tokio-tls v0.3.1
  Downloaded utf-8 v0.7.5
  Downloaded rand_chacha v0.2.2
  Downloaded mime_guess v2.0.3
  Downloaded net2 v0.2.34
  Downloaded cookie v0.12.0
  Downloaded percent-encoding v2.1.0
  Downloaded futures-timer v3.0.2
  Downloaded serde_json v1.0.55
  Downloaded signal-hook-registry v1.2.0
  Downloaded kv-log-macro v1.0.6
  Downloaded openssl-probe v0.1.2
  Downloaded thiserror v1.0.19
  Downloaded hyper-tls v0.4.1
  Downloaded getrandom v0.1.14
  Downloaded sha-1 v0.8.2
  Downloaded mime v0.3.16
  Downloaded want v0.3.0
  Downloaded omnom v2.1.2
  Downloaded http-body v0.3.1
  Downloaded h2 v0.2.5
  Downloaded input_buffer v0.3.1
  Downloaded http-client v3.0.0
  Downloaded serde v1.0.111
  Downloaded itoa v0.4.5
  Downloaded idna v0.2.0
  Downloaded byteorder v1.3.4
  Downloaded serde_urlencoded v0.6.1
  Downloaded time v0.1.43
  Downloaded encoding_rs v0.8.23
  Downloaded gloo-timers v0.2.1
  Downloaded cc v1.0.54
  Downloaded ppv-lite86 v0.2.8
  Downloaded serde_derive v1.0.111
  Downloaded opaque-debug v0.2.3
  Downloaded thiserror-impl v1.0.19
  Downloaded ryu v1.0.5
  Downloaded unicase v2.6.0
  Downloaded tokio-util v0.3.1
  Downloaded block-buffer v0.7.3
  Downloaded pkg-config v0.3.17
  Downloaded indexmap v1.4.0
  Downloaded unicode-bidi v0.3.4
  Downloaded tendril v0.4.1
  Downloaded arc-swap v0.4.7
  Downloaded getopts v0.2.21
  Downloaded selectors v0.21.0
  Downloaded html5ever v0.24.1
  Downloaded digest v0.8.1
  Downloaded try-lock v0.2.2
  Downloaded fake-simd v0.1.2
  Downloaded byte-pool v0.2.1
  Downloaded smallvec v0.6.13
  Downloaded foreign-types v0.3.2
  Downloaded send_wrapper v0.4.0
  Downloaded unicode-normalization v0.1.12
  Downloaded ego-tree v0.6.2
  Downloaded cssparser v0.25.9
  Downloaded async-h1 v2.0.2
  Downloaded js-sys v0.3.40
  Downloaded block-padding v0.1.5
  Downloaded dtoa v0.4.5
  Downloaded phf v0.7.24
  Downloaded phf_codegen v0.7.24
  Downloaded version_check v0.9.2
  Downloaded futf v0.1.4
  Downloaded precomputed-hash v0.1.1
  Downloaded byte-tools v0.3.1
  Downloaded thin-slice v0.1.1
  Downloaded smallvec v1.4.0
  Downloaded wasm-bindgen v0.2.63
  Downloaded web-sys v0.3.40
  Downloaded generic-array v0.12.3
  Downloaded unicode-width v0.1.7
  Downloaded mac v0.1.1
  Downloaded markup5ever v0.9.0
  Downloaded foreign-types-shared v0.1.1
  Downloaded new_debug_unreachable v1.0.4
  Downloaded phf_generator v0.7.24
  Downloaded procedural-masquerade v0.1.6
  Downloaded typenum v1.12.0
  Downloaded wasm-bindgen-macro v0.2.63
  Downloaded phf_shared v0.7.24
  Downloaded cssparser-macros v0.3.6
  Downloaded servo_arc v0.1.1
  Downloaded dtoa-short v0.3.2
  Downloaded wasm-bindgen-macro-support v0.2.63
  Downloaded http-types v2.2.0
  Downloaded string_cache v0.7.5
  Downloaded string_cache_codegen v0.4.4
  Downloaded siphasher v0.2.3
  Downloaded wasm-bindgen-shared v0.2.63
  Downloaded string_cache_shared v0.3.0
  Downloaded cookie v0.14.1
  Downloaded wasm-bindgen-backend v0.2.63
  Downloaded aes-gcm v0.5.0
  Downloaded sha2 v0.8.2
  Downloaded hmac v0.7.1
  Downloaded time v0.2.16
  Downloaded hkdf v0.8.0
  Downloaded bumpalo v3.4.0
  Downloaded subtle v2.2.3
  Downloaded zeroize v1.1.0
  Downloaded ghash v0.2.3
  Downloaded block-cipher-trait v0.6.2
  Downloaded crypto-mac v0.7.0
  Downloaded standback v0.2.9
  Downloaded aead v0.2.0
  Downloaded polyval v0.3.3
  Downloaded subtle v1.0.0
  Downloaded time-macros v0.1.0
  Downloaded aes v0.3.2
  Downloaded universal-hash v0.3.0
  Downloaded time-macros-impl v0.1.1
  Downloaded aes-soft v0.3.3
   Compiling proc-macro2 v1.0.18
   Compiling unicode-xid v0.2.0
   Compiling wasm-bindgen-shared v0.2.63
   Compiling log v0.4.8
   Compiling syn v1.0.31
   Compiling cfg-if v0.1.10
   Compiling bumpalo v3.4.0
   Compiling ryu v1.0.5
   Compiling serde v1.0.111
   Compiling lazy_static v1.4.0
   Compiling libc v0.2.71
   Compiling autocfg v0.1.7
   Compiling typenum v1.12.0
   Compiling byteorder v1.3.4
   Compiling serde_json v1.0.55
   Compiling wasm-bindgen v0.2.63
   Compiling version_check v0.9.2
   Compiling itoa v0.4.5
   Compiling autocfg v1.0.0
   Compiling rand_core v0.4.2
   Compiling getrandom v0.1.14
   Compiling maybe-uninit v2.0.0
   Compiling memchr v2.3.3
   Compiling proc-macro-nested v0.1.5
   Compiling once_cell v1.4.0
   Compiling futures-core v0.3.5
   Compiling futures v0.1.29
   Compiling siphasher v0.2.3
   Compiling subtle v2.2.3
   Compiling futures-sink v0.3.5
   Compiling proc-macro-hack v0.5.16
   Compiling scopeguard v1.1.0
   Compiling byte-tools v0.3.1
   Compiling pin-utils v0.1.0
   Compiling cc v1.0.54
   Compiling futures-io v0.3.5
   Compiling opaque-debug v0.2.3
   Compiling pkg-config v0.3.17
   Compiling matches v0.1.8
   Compiling slab v0.4.2
   Compiling smallvec v1.4.0
   Compiling subtle v1.0.0
   Compiling string_cache_shared v0.3.0
   Compiling ppv-lite86 v0.2.8
   Compiling bitflags v1.2.1
   Compiling fnv v1.0.7
   Compiling percent-encoding v2.1.0
   Compiling zeroize v1.1.0
   Compiling async-task v3.0.0
   Compiling openssl v0.10.29
   Compiling scoped-tls-hkt v0.1.2
   Compiling anyhow v1.0.31
   Compiling bytes v0.5.4
   Compiling foreign-types-shared v0.1.1
   Compiling pin-project-lite v0.1.7
   Compiling fake-simd v0.1.2
   Compiling send_wrapper v0.4.0
   Compiling new_debug_unreachable v1.0.4
   Compiling native-tls v0.2.4
   Compiling base64 v0.12.1
   Compiling dtoa v0.4.5
error: `core::slice::<impl [T]>::len` is not yet stable as a const fn
   --> /home/darreng/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.5.4/src/bytes.rs:130:18
    |
130 |             len: bytes.len(),
    |                  ^^^^^^^^^^^

error: aborting due to previous error

error: Could not compile `bytes`.
warning: build failed, waiting for other jobs to finish...
error: build failed
dazzag24 commented 4 years ago

After updating using rustup the issue was resolved:

darreng@DazXPS:~/code/rust/smol/examples$ rustup update stable
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: latest update on 2020-06-04, rust version 1.44.0 (49cae5576 2020-06-01)
info: downloading component 'rustc'
 60.2 MiB /  60.2 MiB (100 %)  13.1 MiB/s in  4s ETA:  0s
info: downloading component 'rust-std'
 17.6 MiB /  17.6 MiB (100 %)  12.3 MiB/s in  1s ETA:  0s
info: downloading component 'cargo'
info: downloading component 'rust-docs'
 12.2 MiB /  12.2 MiB (100 %)  12.0 MiB/s in  1s ETA:  0s
info: removing previous version of component 'rustc'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'cargo'
info: removing previous version of component 'rust-docs'
info: installing component 'rustc'
 60.2 MiB /  60.2 MiB (100 %)  16.2 MiB/s in  3s ETA:  0s
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
 12.2 MiB /  12.2 MiB (100 %)  11.1 MiB/s in  1s ETA:  0s

  stable-x86_64-unknown-linux-gnu updated - rustc 1.44.0 (49cae5576 2020-06-01) (from rustc 1.38.0 (625451e37 2019-09-23))

info: checking for self-updates
darreng@DazXPS:~/code/rust/smol/examples$ cargo --version
cargo 1.44.0 (05d080faa 2020-05-06)
darreng@DazXPS:~/code/rust/smol/examples$ rustc --version
rustc 1.44.0 (49cae5576 2020-06-01)
darreng@DazXPS:~/code/rust/smol/examples$ cargo run --example ctrl-c
   Compiling libc v0.2.71
   Compiling cfg-if v0.1.10
   Compiling proc-macro2 v1.0.18
   Compiling unicode-xid v0.2.0
   Compiling syn v1.0.31
   Compiling log v0.4.8
   Compiling autocfg v1.0.0
   Compiling lazy_static v1.4.0
   Compiling byteorder v1.3.4
   Compiling itoa v0.4.5
   Compiling autocfg v0.1.7
   Compiling typenum v1.12.0
   Compiling serde v1.0.111
   Compiling futures-core v0.3.5
   Compiling memchr v2.3.3
   Compiling rand_core v0.4.2
   Compiling proc-macro-hack v0.5.16
   Compiling futures-sink v0.3.5
   Compiling slab v0.4.2
   Compiling ryu v1.0.5
   Compiling serde_json v1.0.55
   Compiling maybe-uninit v2.0.0
   Compiling proc-macro-nested v0.1.5
   Compiling futures v0.1.29
   Compiling version_check v0.9.2
   Compiling once_cell v1.4.0
   Compiling pin-utils v0.1.0
   Compiling futures-io v0.3.5
   Compiling wasm-bindgen-shared v0.2.63
   Compiling siphasher v0.2.3
   Compiling bitflags v1.2.1
   Compiling matches v0.1.8
   Compiling bumpalo v3.4.0
   Compiling pin-project-lite v0.1.7
   Compiling pkg-config v0.3.17
   Compiling cc v1.0.54
   Compiling wasm-bindgen v0.2.63
   Compiling smallvec v1.4.0
   Compiling percent-encoding v2.1.0
   Compiling bytes v0.5.4
   Compiling scopeguard v1.1.0
   Compiling getrandom v0.1.14
   Compiling opaque-debug v0.2.3
   Compiling fnv v1.0.7
   Compiling scoped-tls-hkt v0.1.2
   Compiling openssl v0.10.29
   Compiling async-task v3.0.0
   Compiling byte-tools v0.3.1
   Compiling httparse v1.3.4
   Compiling foreign-types-shared v0.1.1
   Compiling native-tls v0.2.4
   Compiling dtoa v0.4.5
   Compiling send_wrapper v0.4.0
   Compiling ppv-lite86 v0.2.8
   Compiling string_cache_shared v0.3.0
   Compiling openssl-probe v0.1.2
   Compiling fake-simd v0.1.2
   Compiling subtle v2.2.3
   Compiling anyhow v1.0.31
   Compiling stable_deref_trait v1.1.1
   Compiling subtle v1.0.0
   Compiling utf-8 v0.7.5
   Compiling zeroize v1.1.0
   Compiling new_debug_unreachable v1.0.4
   Compiling base64 v0.12.1
   Compiling precomputed-hash v0.1.1
   Compiling mac v0.1.1
   Compiling try-lock v0.2.2
   Compiling procedural-masquerade v0.1.6
   Compiling nodrop v0.1.14
   Compiling encoding_rs v0.8.23
   Compiling tower-service v0.3.0
   Compiling mime v0.3.16
   Compiling nix v0.17.0
   Compiling unicode-width v0.1.7
   Compiling base64 v0.11.0
   Compiling arc-swap v0.4.7
   Compiling void v1.0.2
   Compiling thin-slice v0.1.1
   Compiling remove_dir_all v0.5.2
   Compiling ego-tree v0.6.2
   Compiling rand_core v0.3.1
   Compiling rand_jitter v0.1.4
   Compiling futures-channel v0.3.5
   Compiling crossbeam-utils v0.7.2
   Compiling memoffset v0.5.4
   Compiling crossbeam-epoch v0.8.2
   Compiling indexmap v1.4.0
   Compiling rand_pcg v0.1.2
   Compiling rand_chacha v0.1.1
   Compiling rand v0.6.5
   Compiling futures-task v0.3.5
   Compiling unicode-bidi v0.3.4
   Compiling phf_shared v0.7.24
   Compiling standback v0.2.9
   Compiling unicase v2.6.0
   Compiling time v0.2.16
   Compiling unicode-normalization v0.1.12
   Compiling block-padding v0.1.5
   Compiling http v0.2.1
   Compiling input_buffer v0.3.1
   Compiling foreign-types v0.3.2
   Compiling dtoa-short v0.3.2
   Compiling futf v0.1.4
   Compiling servo_arc v0.1.1
   Compiling getopts v0.2.21
   Compiling rand_xorshift v0.1.1
   Compiling rand_isaac v0.1.1
   Compiling rand_hc v0.1.0
   Compiling phf v0.7.24
   Compiling openssl-sys v0.9.58
   Compiling tendril v0.4.1
   Compiling kv-log-macro v1.0.6
   Compiling want v0.3.0
   Compiling infer v0.1.6
   Compiling fxhash v0.2.1
   Compiling quote v1.0.7
   Compiling idna v0.2.0
   Compiling smallvec v0.6.13
   Compiling omnom v2.1.2
   Compiling generic-array v0.12.3
   Compiling iovec v0.1.4
   Compiling num_cpus v1.13.0
   Compiling rand_os v0.1.3
   Compiling socket2 v0.3.12
   Compiling net2 v0.2.34
   Compiling time v0.1.43
   Compiling signal-hook-registry v1.2.0
   Compiling inotify-sys v0.1.3
   Compiling timerfd v1.1.1
   Compiling http-body v0.3.1
   Compiling crossbeam-queue v0.2.3
   Compiling url v2.1.1
   Compiling bytes v0.4.12
   Compiling mime_guess v2.0.3
   Compiling digest v0.8.1
   Compiling block-buffer v0.7.3
   Compiling block-cipher-trait v0.6.2
   Compiling universal-hash v0.3.0
   Compiling crypto-mac v0.7.0
   Compiling aead v0.2.0
   Compiling rand_core v0.5.1
   Compiling signal-hook v0.1.15
   Compiling inotify v0.8.3
   Compiling mio v0.6.22
   Compiling cookie v0.12.0
   Compiling byte-pool v0.2.1
   Compiling crossbeam-deque v0.7.3
   Compiling sha2 v0.8.2
   Compiling sha-1 v0.8.2
   Compiling aes-soft v0.3.3
   Compiling polyval v0.3.3
   Compiling tokio-io v0.1.13
   Compiling hmac v0.7.1
   Compiling rand_chacha v0.2.2
   Compiling phf_generator v0.7.24
   Compiling tokio v0.2.21
   Compiling ghash v0.2.3
   Compiling aes v0.3.2
   Compiling hkdf v0.8.0
   Compiling phf_codegen v0.7.24
   Compiling string_cache_codegen v0.4.4
   Compiling aes-gcm v0.5.0
   Compiling rand v0.7.3
   Compiling selectors v0.21.0
   Compiling ctrlc v3.1.4
   Compiling string_cache v0.7.5
   Compiling tempfile v3.1.0
   Compiling tungstenite v0.10.1
   Compiling tokio-util v0.3.1
   Compiling tokio-tls v0.3.1
   Compiling wasm-bindgen-backend v0.2.63
   Compiling wasm-bindgen-macro-support v0.2.63
   Compiling serde_derive v1.0.111
   Compiling pin-project-internal v0.4.20
   Compiling futures-macro v0.3.5
   Compiling time-macros-impl v0.1.1
   Compiling thiserror-impl v1.0.19
   Compiling cssparser v0.25.9
   Compiling cssparser-macros v0.3.6
   Compiling html5ever v0.24.1
   Compiling wasm-bindgen-macro v0.2.63
   Compiling time-macros v0.1.0
   Compiling thiserror v1.0.19
   Compiling cookie v0.14.1
   Compiling pin-project v0.4.20
   Compiling futures-util v0.3.5
   Compiling piper v0.1.3
   Compiling h2 v0.2.5
   Compiling futures-executor v0.3.5
   Compiling futures v0.3.5
   Compiling smol v0.1.11
   Compiling smol v0.1.11 (/home/darreng/code/rust/smol)
   Compiling hyper v0.13.6
   Compiling serde_urlencoded v0.6.1
   Compiling markup5ever v0.9.0
   Compiling js-sys v0.3.40
   Compiling hyper-tls v0.4.1
   Compiling reqwest v0.10.6
   Compiling scraper v0.11.0
   Compiling web-sys v0.3.40
   Compiling gloo-timers v0.2.1
   Compiling futures-timer v3.0.2
   Compiling async-std v1.6.1
   Compiling http-types v2.2.0
   Compiling async-native-tls v0.3.3
   Compiling http-types v1.3.1
   Compiling async-tungstenite v0.4.2
   Compiling async-h1 v1.1.2
   Compiling async-h1 v2.0.2
   Compiling http-client v3.0.0
   Compiling surf v2.0.0-alpha.4
   Compiling smol-examples v0.0.0 (/home/darreng/code/rust/smol/examples)
    Finished dev [unoptimized + debuginfo] target(s) in 1m 08s
     Running `/home/darreng/code/rust/smol/target/debug/examples/ctrl-c`
Waiting for Ctrl-C...
^CDone!