Rust 为什么这个无关的板条箱破坏了我的项目?

Rust 为什么这个无关的板条箱破坏了我的项目?,rust,Rust,当我试图编译我的项目时,我得到一个错误,那就是cargo.toml中没有的板条箱坏了。为什么这个无关的板条箱破坏了我的项目 $ cargo build Downloading pear_codegen v0.0.16 Compiling pear_codegen v0.0.16 Compiling ring v0.11.0 error[E0023]: this pattern has 1 fie

当我试图编译我的项目时,我得到一个错误,那就是cargo.toml中没有的板条箱坏了。为什么这个无关的板条箱破坏了我的项目

$ cargo build
 Downloading pear_codegen v0.0.16
 Compiling pear_codegen v0.0.16                                               
 Compiling ring v0.11.0
 error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
 --> /.cargo/registry/src/github.com-1ecc6299db9ec823/pear_codegen-0.0.16/src/lib.rs:317:9
     |
 317 |         ExprKind::Block(block) => {
     |         ^^^^^^^^^^^^^^^^^^^^^^ expected 2 fields, found 1

 error: aborting due to previous error

For more information about this error, try `rustc --explain E0023`.
error: Could not compile `pear_codegen`.
warning: build failed, waiting for other jobs to finish...
error: build failed
为我解决了这个问题


您每晚都在使用Rust,而所讨论的板条箱(在版本
0.0.16
中)依赖于Rust编译器的perma不稳定API,该API因您每晚更新(或刚刚安装)而更改。

作者使用板条箱以避免这种依赖性,这意味着应从板条箱的版本
0.0.17
开始,应避免进一步的破坏。

注意依赖性是可传递的;如果您的项目依赖于依赖于
B
A
,那么您的项目也依赖于
B
,即使Cargo.toml中没有明确的依赖关系。这实际上是依赖关系管理系统(如Cargo)最重要的功能之一!
cargo update