获取`错误:由于以前的错误而无法编译``libp2p-noise'

发布于 2025-01-28 09:40:15 字数 1242 浏览 2 评论 0原文

我一直在尝试编译一个替代项目,但会遇到这个奇怪的错误。

error[E0282]: type annotations needed
   --> /Users/ayushkumarmishra/.cargo/registry/src/github.com-1ecc6299db9ec823/libp2p-noise-0.32.0/src/protocol/x25519.rs:221:45
    |
221 |         curve25519_sk.copy_from_slice(&hash.as_ref()[..32]);
    |                                        -----^^^^^^--
    |                                        |    |
    |                                        |    cannot infer type for type parameter `T` declared on the trait `AsRef`
    |                                        this method call resolves to `&T`
    |
    = note: type must be known at this point

For more information about this error, try `rustc --explain E0282`.
error: could not compile `libp2p-noise` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed

有人可以帮我解决这个问题吗?

的输出

以下是Rustup Show安装工具链

稳定-Aarch64-Apple-darwin 夜间2021-08-31-AARCH64-APPLE-DARWIN Nightly-2021-11-07-Aarch64-Apple-darwin(默认)

的目标

安装了主动工具链AARCH64-APPLE-DARWIN WASM32未知的

主动工具链

每晚2021-11-07-AARCH64-APPLE-DARWIN(默认)

Rustc 1.58.0-oftightly(072799443 2021-11-06)

I have been trying to compile a Substarte project but getting this weird error.

error[E0282]: type annotations needed
   --> /Users/ayushkumarmishra/.cargo/registry/src/github.com-1ecc6299db9ec823/libp2p-noise-0.32.0/src/protocol/x25519.rs:221:45
    |
221 |         curve25519_sk.copy_from_slice(&hash.as_ref()[..32]);
    |                                        -----^^^^^^--
    |                                        |    |
    |                                        |    cannot infer type for type parameter `T` declared on the trait `AsRef`
    |                                        this method call resolves to `&T`
    |
    = note: type must be known at this point

For more information about this error, try `rustc --explain E0282`.
error: could not compile `libp2p-noise` due to previous error
warning: build failed, waiting for other jobs to finish...
error: build failed

Can somebody please help me to fix this?

Below is the output of rustup show

installed toolchains

stable-aarch64-apple-darwin
nightly-2021-08-31-aarch64-apple-darwin
nightly-2021-11-07-aarch64-apple-darwin (default)

installed targets for active toolchain

aarch64-apple-darwin
wasm32-unknown-unknown

active toolchain

nightly-2021-11-07-aarch64-apple-darwin (default)

rustc 1.58.0-nightly (072799443 2021-11-06)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文