Error while building rust with libp2p-0.53.1

84 Views Asked by At

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?

1

There are 1 best solutions below

0
kmdreko On

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.