如何解决 Rust 的 Cargo Check 中的 E0658(下划线命名)?

How to resolve E0658 (underscore naming) in Rust's Cargo Check?

我收到 运行 cargo check rust-s3 箱子的错误。 我找到的所有文档似乎都表明这是一个已解决的问题。

我是否缺少 Cargo.toml 中的设置或选项或其他内容?

这是检查错误:

error[E0658]: naming constants with `_` is unstable
   --> /Users/andrevan/.cargo/registry/src/github.com-1ecc6299db9ec823/bytes-0.5.4/src/bytes.rs:911:1
    |
911 | const _: [(); 0 - mem::align_of::<Shared>() % 2] = []; // Assert that the alignment of `Shared` is divisible by 2.
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/54912

感谢@SCappella 的评论,我发现我使用的 brew 安装版 Rust 比下划线修复程序旧。

brew remove rust 然后重新安装了 Rust 工具链,它现在可以工作了。

谢谢@SCappella。