错误:在构建 Rust 时出现 libp2p-0.53.1 错误。

huangapple go评论73阅读模式
英文:

Error while building rust with libp2p-0.53.1

问题

I am trying to upgrade a project, that has vendored crates, from using libp2p 0.46 to 0.53.1 but I am getting an error when I try to build it.

error[E0599]: no method named `as_pin_mut` found for struct `Pin<&mut either::Either<A, B>>` in the current scope
   --> <project>/vendor/crates/libp2p-core-0.39.2/src/either.rs:147:20
    |
147 |         match self.as_pin_mut() {
    |                    ^^^^^^^^^^ help: there is a method with a similar name: `as_mut`

For more information about this error, try `rustc --explain E0599`

Any ideas why this might happen?

英文:

I am trying to upgrade a project, that has vendored crates, from using libp2p 0.46 to 0.53.1 but I am getting an error when I try to build it.

error[E0599]: no method named `as_pin_mut` found for struct `Pin&lt;&amp;mut either::Either&lt;A, B&gt;&gt;` in the current scope
   --&gt; &lt;project&gt;/vendor/crates/libp2p-core-0.39.2/src/either.rs:147:20
    |
147 |         match self.as_pin_mut() {
    |                    ^^^^^^^^^^ help: there is a method with a similar name: `as_mut`

For more information about this error, try `rustc --explain E0599`

Any ideas why this might happen?

答案1

得分: 2

It seems libp2p-core uses either v1.5 as a dependency but the latest version is using a method only available in either as of v1.8. So when you updated to the latest version of libp2p, your existing version of either (v1.6.1 apparently) was "still good" so it wasn't updated along in tandem.

The quick fix would just be to update the version of either using cargo update:

cargo update -p either

I have filed an issue so hopefully this gets addressed.

英文:

It seems libp2p-core uses either v1.5 as a dependency but the latest version is using a method only available in either as of v1.8. So when you updated to the latest version of libp2p, your existing version of either (v1.6.1 apparently) was "still good" so it wasn't updated along in tandem.

The quick fix would just be to update the version of either using cargo update:

cargo update -p either

I have filed an issue so hopefully this gets addressed.

huangapple
  • 本文由 发表于 2023年5月11日 00:24:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76220673.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定