結論
- ダウングレード(Rust 1.42.0 を使っている場合)
[dependencies] proconio = "0.4.3"
↓
[dependencies] proconio = "0.3.8"
前提
- rust のバージョン(Atcoder の対応バージョン)
rustc 1.42.0 (b8cedc004 2020-03-09)
- Docker のバージョン
Server: Docker Desktop 4.9.1 (81317)
起こったこと
参考ビルドログ
root@c1a999dc7e00:/workspace# cargo run Updating crates.io index Compiling proconio v0.4.5 error[E0432]: unresolved import
std::sync::OnceLock
--> /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/proconio-0.4.5/src/lib.rs:517:5 | 517 | use std::sync::OnceLock; | ^^^^^^^^^^^^^^^^^^^ noOnceLock
insync
error: aborting due to previous error For more information about this error, tryrustc --explain E0432
. error: could not compileproconio
. To learn more, run the command again with --verbose.- Cargo.lock 抜粋
# This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] name = "package_name" version = "0.1.0" dependencies = [ "proconio", ] [[package]] name = "proconio" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eb404616795079e2390e7115acf0ada24e9332e8476de2aada7bacb9992dc9e"
考察
- Cargo.toml 内で 0.4.3 を指定したはずなのに 0.4.5 が参照されてるっぽい
- github を追ったらここ一週間くらいで 0.4.3 から 0.4.5 になっていた
- proconio v0.4.5 で Rust 1.70 の対応をしていておそらくその機能内で Rust 1.42 にない何かが混ざりコンパイルできなくなった
crates.io をのぞいてみた
- 緑色だけが有効だとすると 0.4.3 は使えなくなっている...?
まとめ
- バージョンアップデートがあると急に動かなくなる....?
- Docker Image を Rust 1.70 にしたら動いた
- proconio の基礎的な機能を使うだけならアップデートしてしまっていいかもしれない
- Rust1.70 だと数字から package name が始まるのはだめらしい
- Cargo ってめっちゃいい管理システムだと思ってたけど結構壊滅的....?