qryxip / snowchains

Tools for online programming contests.
Apache License 2.0
21 stars 6 forks source link

Build failure on E0599 #81

Closed kmyk closed 4 years ago

kmyk commented 4 years ago

このあと rustup update ってしてからもう一度試したら通ったんですが、Rust 処理系の特定のバージョンでしか動かないなら README に書くか Cargo.toml の設定で弾くなどをしておいてほしい

$ cargo --version
cargo 1.42.0 (86334295e 2020-01-31)

$ rustc --version
rustc 1.42.0 (b8cedc004 2020-03-09)

$ cat /etc/os-release 
NAME="Ubuntu"
VERSION="18.04.5 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.5 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic

$ cargo install snowchains
    Updating crates.io index
  Downloaded snowchains v0.5.0
  Downloaded 1 crate (49.8 KB) in 1.49s
  Installing snowchains v0.5.0
  Downloaded indexmap v1.5.1
  Downloaded termcolor v1.1.0
  Downloaded rprompt v1.0.5
  Downloaded serde_yaml v0.8.13
  Downloaded anyhow v1.0.32
  Downloaded dirs v3.0.1
  Downloaded atty v0.2.14
  Downloaded either v1.6.0
  Downloaded structopt v0.3.16
  Downloaded tempfile v3.1.0
  Downloaded strum v0.18.0
  Downloaded shell-escape v0.1.5
  Downloaded serde v1.0.115
  Downloaded reqwest v0.10.7
  Downloaded maplit v1.0.2
  Downloaded rpassword v4.0.5
  Downloaded serde_json v1.0.57
  Downloaded heck v0.3.1
  Downloaded tokio v0.2.22
  Downloaded url v2.1.1
  Downloaded human-size v0.4.1
  Downloaded fwdansi v1.1.0
  Downloaded serde_dhall v0.5.3
  Downloaded az v1.0.0
  Downloaded snowchains_core v0.4.2
  Downloaded indicatif v0.15.0
  Downloaded dhall v0.5.3
  Downloaded mime v0.3.16
  Downloaded http v0.2.1
  Downloaded linked-hash-map v0.5.3
  Downloaded signal-hook-registry v1.2.1
  Downloaded mio-uds v0.6.8
  Downloaded structopt-derive v0.4.9
  Downloaded num_cpus v1.13.0
  Downloaded yaml-rust v0.4.4
  Downloaded futures-core v0.3.5
  Downloaded rustls v0.18.1
  Downloaded base64 v0.12.3
  Downloaded libc v0.2.76
  Downloaded cookie_store v0.12.0
  Downloaded tokio-tls v0.3.1
  Downloaded autocfg v1.0.1
  Downloaded mime_guess v2.0.3
  Downloaded ryu v1.0.5
  Downloaded dtoa v0.4.6
  Downloaded ppv-lite86 v0.2.9
  Downloaded doc-comment v0.3.3
  Downloaded hyper-tls v0.4.3
  Downloaded rand_pcg v0.2.1
  Downloaded encoding_rs v0.8.23
  Downloaded http-body v0.3.1
  Downloaded webpki-roots v0.19.0
  Downloaded remove_dir_all v0.5.3
  Downloaded clap v2.33.3
  Downloaded log v0.4.11
  Downloaded ipnet v2.3.0
  Downloaded idna v0.2.0
  Downloaded fnv v1.0.7
  Downloaded matches v0.1.8
  Downloaded itoa v0.4.6
  Downloaded serde_urlencoded v0.6.1
  Downloaded strum_macros v0.18.0
  Downloaded memchr v2.3.3
  Downloaded unicode-segmentation v1.6.0
  Downloaded mio v0.6.22
  Downloaded percent-encoding v2.1.0
  Downloaded hyper v0.13.7
  Downloaded slab v0.4.2
  Downloaded iovec v0.1.4
  Downloaded futures-util v0.3.5
  Downloaded dhall_proc_macros v0.5.0
  Downloaded serde_derive v1.0.115
  Downloaded hashbrown v0.8.2
  Downloaded pin-project-lite v0.1.7
  Downloaded bytes v0.5.6
  Downloaded hyper-rustls v0.21.0
  Downloaded tokio-rustls v0.14.0
  Downloaded syn v1.0.38
  Downloaded fs2 v0.4.3
  Downloaded futures-io v0.3.5
  Downloaded socket2 v0.3.12
  Downloaded pest v2.1.3
  Downloaded time v0.2.16
  Downloaded unicode-normalization v0.1.13
  Downloaded rayon v1.3.1
  Downloaded hex v0.4.2
  Downloaded strsim v0.8.0
  Downloaded unicase v2.6.0
  Downloaded proc-macro-hack v0.5.18
  Downloaded humantime-serde v1.0.0
  Downloaded publicsuffix v1.5.4
  Downloaded proc-macro2 v1.0.19
  Downloaded walkdir v2.3.1
  Downloaded futures-channel v0.3.5
  Downloaded textwrap v0.11.0
  Downloaded want v0.3.0
  Downloaded vec_map v0.8.2
  Downloaded pin-utils v0.1.0
  Downloaded tower-service v0.3.0
  Downloaded pin-project v0.4.23
  Downloaded regex v1.3.9
  Downloaded unicode-width v0.1.8
  Downloaded time v0.1.43
  Downloaded sha2 v0.9.1
  Downloaded proc-macro-error v1.0.4
  Downloaded humantime v2.0.1
  Downloaded ignore v0.4.16
  Downloaded chrono v0.4.15
  Downloaded abnf_to_pest v0.5.0
  Downloaded futures-macro v0.3.5
  Downloaded smallvec v1.4.2
  Downloaded derive_more v0.99.9
  Downloaded console v0.12.0
  Downloaded pest_generator v2.1.3
  Downloaded httparse v1.3.4
  Downloaded unicode-bidi v0.3.4
  Downloaded cookie v0.14.2
  Downloaded sha2 v0.8.2
  Downloaded quote v1.0.7
  Downloaded h2 v0.2.6
  Downloaded derivative v2.1.1
  Downloaded webpki v0.21.3
  Downloaded prettytable-rs v0.8.0
  Downloaded tracing v0.1.19
  Downloaded proc-macro-nested v0.1.6
  Downloaded once_cell v1.4.1
  Downloaded sct v0.6.0
  Downloaded arc-swap v0.4.7
  Downloaded futures-task v0.3.5
  Downloaded net2 v0.2.34
  Downloaded ansi_term v0.11.0
  Downloaded scraper v0.12.0
  Downloaded pest_consume v1.0.5
  Downloaded ring v0.16.15
  Downloaded easy-ext v0.2.2
  Downloaded strum v0.19.2
  Downloaded number_prefix v0.3.0
  Downloaded serde_cbor v0.9.0
  Downloaded annotate-snippets v0.7.0
  Downloaded unicode-xid v0.2.1
  Downloaded block-buffer v0.7.3
  Downloaded memoffset v0.5.5
  Downloaded num-integer v0.1.43
  Downloaded terminal_size v0.1.13
  Downloaded ucd-trie v0.1.3
  Downloaded untrusted v0.7.1
  Downloaded try-lock v0.2.3
  Downloaded standback v0.2.9
  Downloaded csv v1.1.3
  Downloaded termios v0.3.2
  Downloaded regex-syntax v0.6.18
  Downloaded tendril v0.4.1
  Downloaded tracing-core v0.1.14
  Downloaded tinyvec v0.3.4
  Downloaded proc-macro-error-attr v1.0.4
  Downloaded encode_unicode v0.3.6
  Downloaded pin-project-internal v0.4.23
  Downloaded opaque-debug v0.3.0
  Downloaded thread_local v1.0.1
  Downloaded dirs-sys v0.3.5
  Downloaded native-tls v0.2.4
  Downloaded cc v1.0.59
  Downloaded error-chain v0.12.4
  Downloaded digest v0.8.1
  Downloaded rayon-core v1.7.1
  Downloaded pest_meta v2.1.3
  Downloaded aho-corasick v0.7.13
  Downloaded html5ever v0.25.1
  Downloaded half v1.6.0
  Downloaded version_check v0.9.2
  Downloaded tokio-util v0.3.1
  Downloaded num-traits v0.2.12
  Downloaded getopts v0.2.21
  Downloaded cpuid-bool v0.1.2
  Downloaded globset v0.4.5
  Downloaded same-file v1.0.6
  Downloaded digest v0.9.0
  Downloaded block-buffer v0.9.0
  Downloaded opaque-debug v0.2.3
  Downloaded pretty v0.5.2
  Downloaded fake-simd v0.1.2
  Downloaded pest_derive v2.1.0
  Downloaded term v0.5.2
  Downloaded spin v0.5.2
  Downloaded time-macros v0.1.0
  Downloaded abnf v0.6.1
  Downloaded futures-sink v0.3.5
  Downloaded cssparser v0.27.2
  Downloaded strum_macros v0.19.2
  Downloaded selectors v0.22.0
  Downloaded pest_consume_macros v1.0.5
  Downloaded ego-tree v0.6.2
  Downloaded bstr v0.2.13
  Downloaded csv-core v0.1.10
  Downloaded byte-tools v0.3.1
  Downloaded utf-8 v0.7.5
  Downloaded markup5ever v0.10.0
  Downloaded generic-array v0.14.4
  Downloaded futf v0.1.4
  Downloaded dirs v1.0.5
  Downloaded openssl v0.10.30
  Downloaded generic-array v0.12.3
  Downloaded block-padding v0.1.5
  Downloaded openssl-sys v0.9.58
  Downloaded typed-arena v1.7.0
  Downloaded openssl-probe v0.1.2
  Downloaded cssparser-macros v0.6.0
  Downloaded time-macros-impl v0.1.1
  Downloaded phf v0.8.0
  Downloaded crossbeam-queue v0.2.3
  Downloaded mac v0.1.1
  Downloaded foreign-types v0.3.2
  Downloaded typenum v1.12.0
  Downloaded servo_arc v0.1.1
  Downloaded precomputed-hash v0.1.1
  Downloaded new_debug_unreachable v1.0.4
  Downloaded string_cache v0.8.0
  Downloaded regex-automata v0.1.9
  Downloaded dtoa-short v0.3.2
  Downloaded phf_codegen v0.8.0
  Downloaded phf_shared v0.8.0
  Downloaded string_cache_codegen v0.5.1
  Downloaded pkg-config v0.3.18
  Downloaded fxhash v0.2.1
  Downloaded phf_macros v0.8.0
  Downloaded thin-slice v0.1.1
  Downloaded foreign-types-shared v0.1.1
  Downloaded nodrop v0.1.14
  Downloaded siphasher v0.3.3
  Downloaded phf_generator v0.8.0
  Downloaded stable_deref_trait v1.2.0
  Downloaded nom v5.1.2
  Downloaded lexical-core v0.7.4
  Downloaded arrayvec v0.5.1
  Downloaded static_assertions v1.1.0
   Compiling proc-macro2 v1.0.19
   Compiling unicode-xid v0.2.1
   Compiling libc v0.2.76
   Compiling syn v1.0.38
   Compiling cfg-if v0.1.10
   Compiling autocfg v1.0.1
   Compiling version_check v0.9.2
   Compiling lazy_static v1.4.0
   Compiling serde_derive v1.0.115
   Compiling serde v1.0.115
   Compiling memchr v2.3.3
   Compiling log v0.4.11
   Compiling proc-macro-hack v0.5.18
   Compiling itoa v0.4.6
   Compiling cc v1.0.59
   Compiling getrandom v0.1.14
   Compiling ryu v1.0.5
   Compiling bitflags v1.2.1
   Compiling byteorder v1.3.4
   Compiling ppv-lite86 v0.2.9
   Compiling siphasher v0.3.3
   Compiling fnv v1.0.7
   Compiling once_cell v1.4.1
   Compiling slab v0.4.2
   Compiling futures-core v0.3.5
   Compiling bytes v0.5.6
   Compiling arc-swap v0.4.7
   Compiling typenum v1.12.0
   Compiling matches v0.1.8
   Compiling pkg-config v0.3.18
   Compiling pin-project-internal v0.4.23
   Compiling pin-project-lite v0.1.7
   Compiling serde_json v1.0.57
   Compiling proc-macro-nested v0.1.6
   Compiling spin v0.5.2
   Compiling untrusted v0.7.1
   Compiling tinyvec v0.3.4
   Compiling either v1.6.0
   Compiling dtoa v0.4.6
   Compiling lexical-core v0.7.4
   Compiling futures-io v0.3.5
   Compiling httparse v1.3.4
   Compiling unicode-segmentation v1.6.0
   Compiling static_assertions v1.1.0
   Compiling maybe-uninit v2.0.0
   Compiling futures-sink v0.3.5
   Compiling unicode-width v0.1.8
   Compiling pin-utils v0.1.0
   Compiling percent-encoding v2.1.0
   Compiling ucd-trie v0.1.3
   Compiling foreign-types-shared v0.1.1
   Compiling maplit v1.0.2
   Compiling openssl v0.10.30
   Compiling arrayvec v0.5.1
   Compiling native-tls v0.2.4
   Compiling regex-syntax v0.6.18
   Compiling try-lock v0.2.3
   Compiling new_debug_unreachable v1.0.4
   Compiling openssl-probe v0.1.2
   Compiling tower-service v0.3.0
   Compiling same-file v1.0.6
   Compiling base64 v0.12.3
   Compiling rayon-core v1.7.1
   Compiling typed-arena v1.7.0
   Compiling precomputed-hash v0.1.1
   Compiling encoding_rs v0.8.23
   Compiling smallvec v1.4.2
   Compiling scopeguard v1.1.0
   Compiling mac v0.1.1
   Compiling utf-8 v0.7.5
   Compiling byte-tools v0.3.1
   Compiling mime v0.3.16
   Compiling nodrop v0.1.14
   Compiling ipnet v2.3.0
   Compiling stable_deref_trait v1.2.0
   Compiling fake-simd v0.1.2
   Compiling hex v0.4.2
   Compiling doc-comment v0.3.3
   Compiling opaque-debug v0.2.3
   Compiling linked-hash-map v0.5.3
   Compiling half v1.6.0
   Compiling thin-slice v0.1.1
   Compiling anyhow v1.0.32
   Compiling number_prefix v0.3.0
   Compiling cpuid-bool v0.1.2
   Compiling termcolor v1.1.0
   Compiling ansi_term v0.11.0
   Compiling humantime v2.0.1
   Compiling vec_map v0.8.2
   Compiling annotate-snippets v0.7.0
   Compiling encode_unicode v0.3.6
   Compiling opaque-debug v0.3.0
   Compiling ego-tree v0.6.2
   Compiling strsim v0.8.0
   Compiling remove_dir_all v0.5.3
   Compiling az v1.0.0
   Compiling shell-escape v0.1.5
   Compiling rprompt v1.0.5
   Compiling human-size v0.4.1
   Compiling tracing-core v0.1.14
   Compiling thread_local v1.0.1
   Compiling hashbrown v0.8.2
   Compiling indexmap v1.5.1
   Compiling crossbeam-utils v0.7.2
   Compiling memoffset v0.5.5
   Compiling crossbeam-epoch v0.8.2
   Compiling num-traits v0.2.12
   Compiling num-integer v0.1.43
   Compiling rayon v1.3.1
   Compiling unicase v2.6.0
   Compiling nom v5.1.2
   Compiling standback v0.2.9
   Compiling generic-array v0.14.4
   Compiling error-chain v0.12.4
   Compiling time v0.2.16
   Compiling proc-macro-error-attr v1.0.4
   Compiling cookie v0.14.2
   Compiling proc-macro-error v1.0.4
   Compiling phf_shared v0.8.0
   Compiling futures-task v0.3.5
   Compiling futures-channel v0.3.5
   Compiling http v0.2.1
   Compiling unicode-bidi v0.3.4
   Compiling itertools v0.9.0
   Compiling unicode-normalization v0.1.13
   Compiling dtoa-short v0.3.2
   Compiling heck v0.3.1
   Compiling getopts v0.2.21
   Compiling textwrap v0.11.0
   Compiling pest v2.1.3
   Compiling foreign-types v0.3.2
   Compiling ring v0.16.15
   Compiling openssl-sys v0.9.58
   Compiling walkdir v2.3.1
   Compiling pretty v0.5.2
   Compiling futf v0.1.4
   Compiling block-padding v0.1.5
   Compiling servo_arc v0.1.1
   Compiling yaml-rust v0.4.4
   Compiling http-body v0.3.1
   Compiling idna v0.2.0
   Compiling pest_meta v2.1.3
   Compiling tendril v0.4.1
   Compiling aho-corasick v0.7.13
   Compiling csv-core v0.1.10
   Compiling fwdansi v1.1.0
   Compiling quote v1.0.7
   Compiling num_cpus v1.13.0
   Compiling iovec v0.1.4
   Compiling net2 v0.2.34
   Compiling signal-hook-registry v1.2.1
   Compiling time v0.1.43
   Compiling socket2 v0.3.12
   Compiling atty v0.2.14
   Compiling termios v0.3.2
   Compiling terminal_size v0.1.13
   Compiling dirs v1.0.5
   Compiling dirs-sys v0.3.5
   Compiling fs2 v0.4.3
   Compiling rpassword v4.0.5
   Compiling tracing v0.1.19
   Compiling want v0.3.0
   Compiling regex-automata v0.1.9
   Compiling fxhash v0.2.1
   Compiling generic-array v0.12.3
   Compiling regex v1.3.9
   Compiling rand_core v0.5.1
   Compiling mio v0.6.22
   Compiling clap v2.33.3
   Compiling term v0.5.2
   Compiling dirs v3.0.1
   Compiling crossbeam-queue v0.2.3
   Compiling mime_guess v2.0.3
   Compiling block-buffer v0.7.3
   Compiling digest v0.8.1
   Compiling block-buffer v0.9.0
   Compiling digest v0.9.0
   Compiling console v0.12.0
   Compiling webpki v0.21.3
   Compiling sct v0.6.0
   Compiling rand_pcg v0.2.1
   Compiling rand_chacha v0.2.2
   Compiling mio-uds v0.6.8
   Compiling pest_generator v2.1.3
   Compiling crossbeam-deque v0.7.3
   Compiling sha2 v0.8.2
   Compiling sha2 v0.9.1
   Compiling webpki-roots v0.19.0
   Compiling rustls v0.18.1
   Compiling abnf v0.6.1
   Compiling rand v0.7.3
   Compiling tokio v0.2.22
   Compiling phf_generator v0.8.0
   Compiling tempfile v3.1.0
   Compiling tokio-util v0.3.1
   Compiling tokio-rustls v0.14.0
   Compiling tokio-tls v0.3.1
   Compiling phf_codegen v0.8.0
   Compiling string_cache_codegen v0.5.1
   Compiling indicatif v0.15.0
   Compiling selectors v0.22.0
   Compiling futures-macro v0.3.5
   Compiling phf_macros v0.8.0
   Compiling cssparser v0.27.2
   Compiling time-macros-impl v0.1.1
   Compiling cssparser-macros v0.6.0
   Compiling html5ever v0.25.1
   Compiling derive_more v0.99.9
   Compiling pest_consume_macros v1.0.5
   Compiling pest_derive v2.1.0
   Compiling strum_macros v0.19.2
   Compiling dhall_proc_macros v0.5.0
   Compiling derivative v2.1.1
   Compiling strum_macros v0.18.0
   Compiling structopt-derive v0.4.9
   Compiling easy-ext v0.2.2
   Compiling phf v0.8.0
   Compiling time-macros v0.1.0
   Compiling pin-project v0.4.23
   Compiling pest_consume v1.0.5
   Compiling strum v0.19.2
   Compiling strum v0.18.0
   Compiling futures-util v0.3.5
   Compiling structopt v0.3.16
   Compiling url v2.1.1
   Compiling bstr v0.2.13
   Compiling string_cache v0.8.0
   Compiling serde_cbor v0.9.0
   Compiling serde_yaml v0.8.13
   Compiling humantime-serde v1.0.0
   Compiling chrono v0.4.15
   Compiling abnf_to_pest v0.5.0
   Compiling h2 v0.2.6
   Compiling serde_urlencoded v0.6.1
   Compiling publicsuffix v1.5.4
   Compiling csv v1.1.3
   Compiling globset v0.4.5
   Compiling markup5ever v0.10.0
   Compiling dhall v0.5.3
   Compiling cookie_store v0.12.0
   Compiling ignore v0.4.16
   Compiling prettytable-rs v0.8.0
   Compiling hyper v0.13.7
   Compiling hyper-rustls v0.21.0
   Compiling hyper-tls v0.4.3
   Compiling scraper v0.12.0
   Compiling reqwest v0.10.7
   Compiling snowchains_core v0.4.2
error: attributes are not yet allowed on `if` expressions
    --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/snowchains_core-0.4.2/src/web/atcoder.rs:1457:13
     |
1457 |             #[allow(clippy::blocks_in_if_conditions)]
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0599]: no associated item named `MAX` found for type `u64` in the current scope
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/snowchains_core-0.4.2/src/web/mod.rs:984:70
    |
984 |                         pb.inc(chunk.len().try_into().unwrap_or(u64::MAX));
    |                                                                      ^^^ associated item not found in `u64`
    |
    = help: items from traits can only be used if the trait is in scope
    = note: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
            candidate #1: `use lexical_core::util::num::Integer;`
            candidate #2: `use lexical_core::util::num::Float;`
            candidate #3: `use rand::distributions::weighted::alias_method::Weight;`
            candidate #4: `use standback::v1_43::float_v1_43;`
            candidate #5: `use standback::v1_43::int_v1_43;`
help: you are looking for the module in `std`, not the primitive type
    |
984 |                         pb.inc(chunk.len().try_into().unwrap_or(std::u64::MAX));
    |                                                                 ^^^^^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0599`.
error: could not compile `snowchains_core`.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `snowchains v0.5.0`, intermediate artifacts can be found at `/tmp/cargo-installtwkIp3`

Caused by:
  build failed
qryxip commented 4 years ago

失念していました。Rust書いている人はだいたいstablenightlyを使っているしバージョンを明記するのがあまり一般的ではないので... (有名どころのプロジェクトでは流石にMSRV (Minimum Supported Rust Version)を明記してたりしますがそれも2世代前(3ヶ月前)だったりします。私の環境にも/usr/bin/cargoみたいなのはありませんしそれでみんなあまり困らないので...)

「設定で弾く」ことをやろうとしたらこうでしょうか。

#[rustversion::before(1.45.2)]
compile_error!("the MSRV is `1.45.2`");

ちなみにCargo.tomlへのMSRVの記述はまだです。

2495-min-rust-version - The Rust RFC Book

kmyk commented 4 years ago

Rust書いている人はだいたいstableかnightlyを使っているしバージョンを明記するのがあまり一般的ではない

そうだったんですね。Rust は新しいバージョンが使われることが多いのは把握してたけれど、6 か月前程度なら動いてほしいと思ってしまいました。5 年前のバージョンでも動くように書くのが普通の言語たちばかり使ってるせいだと思います。

そのような文化が背景にあるのなら (非 Rust ユーザの数次第ですが) 特に書かなくてもよいかもしれません。

kmyk commented 4 years ago

とりあえず閉じておきますね

qryxip commented 4 years ago

「明記するのは一般的ではない」は言いすぎだったかもしれません。みんな書いてる人は書いてる。

あとそういえばMSRVのREADME用badgeがありました。これ貼っておきましょう。

https://github.com/bluss/indexmap