小编xam*_*ore的帖子

如何查看 rustc 错误消息中“和其他 X”的其余部分?

有时,当您遇到错误时,例如关于其他类型实现特征的错误,您会看到如下错误消息:

error[E0277]: the trait bound `Vec<u8>: ToHeader` is not satisfied
 --> src/main.rs:3:35
  |
3 | #[derive(Clone, Debug, PartialEq, NewType)]
  |                                   ^^^^^^^ the trait `ToHeader` is not implemented for `Vec<u8>`
  |
  = help: the following other types implement trait `ToHeader`:
            &T
            Arc<T>
            Box<T>
            HexEncodedBytes
            MaybeUndefined<T>
            Uri
            bool
            f32
          and 13 others
  = note: this error originates in the derive macro `NewType` (in Nightly builds, run with -Z macro-backtrace for more info)
Run Code Online (Sandbox Code Playgroud)

我如何才能看到上面示例中的其他 13 个?我已经尝试过-vv,但没有成功,并且在帮助消息中看不到任何其他内容。

您可以使用以下代码重现此内容:

# Cargo.toml
[dependencies]
poem …
Run Code Online (Sandbox Code Playgroud)

rust rust-cargo rust-poem

8
推荐指数
1
解决办法
101
查看次数

标签 统计

rust ×1

rust-cargo ×1

rust-poem ×1