为什么安装wasm-pack时编译时v0.3.34出现错误?

问题描述 投票:0回答:1

跑步

cargo install wasm-pack

我得到许多绿色的“正在编译”行,然后是以下内容

   Compiling time v0.3.34
error[E0602]: unknown lint: `invalid_reference_casting`
  |
  = note: requested on the command line with `-D invalid_reference_casting`

error[E0602]: unknown lint: `invalid_nan_comparisons`
  |
  = note: requested on the command line with `-D invalid_nan_comparisons`

error[E0602]: unknown lint: `invalid_from_utf8`
  |
  = note: requested on the command line with `-D invalid_from_utf8`

error[E0602]: unknown lint: `hidden_glob_reexports`
  |
  = note: requested on the command line with `-D hidden_glob_reexports`

   Compiling object v0.32.2
   Compiling pbkdf2 v0.11.0
For more information about this error, try `rustc --explain E0602`.
error: could not compile `time` (lib) due to 4 previous errors
warning: build failed, waiting for other jobs to finish...

发生了什么以及如何解决它?

我正在尝试 Rust,所以我不知道该怎么办。 我使用的是 Ubuntu,我的

cargo --version
cargo 1.75.0

rust rust-cargo wasm-pack
1个回答
1
投票

这些 lint 是新引入的:

  • invalid_reference_casting
    :1.72 或更高版本
  • invalid_nan_comparisons
    :1.72 或更高版本
  • invalid_from_utf8
    :1.72 或更高版本

time
的 MSRV 是最新稳定版本,并且是其之前的两个版本,因此其 MSRV 是
1.74
(截至撰写本文时,当前最新稳定版本是
1.76.0
)。

我认为您的工具链已过时。尝试

rustup toolchain list
并通过
rustup update
更新它们。

© www.soinside.com 2019 - 2024. All rights reserved.