Skip to content

Instantly share code, notes, and snippets.

@koivunej
Created August 2, 2021 14:20
Show Gist options
  • Save koivunej/a57c843758b01bd82e9883d9c997e857 to your computer and use it in GitHub Desktop.
Save koivunej/a57c843758b01bd82e9883d9c997e857 to your computer and use it in GitHub Desktop.
When using rust-ipfs as a dependency, an error
error[E0308]: mismatched types
|
::: /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/tokio-1.9.0/src/fs/read_dir.rs:21:50
|
21 | pub async fn read_dir(path: impl AsRef<Path>) -> io::Result<ReadDir> {
| -------------------
| |
| one of the expected opaque types
| one of the found opaque types
...
272 | pub async fn file_type(&self) -> io::Result<FileType> {
| --------------------
| |
| checked the `Output` of this `async fn`, one of the expected opaque types
| checked the `Output` of this `async fn`, one of the found opaque types
--> /home/runner/work/rust-ipfs/rust-ipfs/src/repo/fs/blocks.rs:357:53
|
357 | async fn list(&self) -> Result<Vec<Cid>, Error> {
| _____________________________________________________^
358 | | use futures::future::{ready, Either};
359 | | use futures::stream::{empty, TryStreamExt};
360 | | use tokio_stream::wrappers::ReadDirStream;
... |
397 | | .await
398 | | }
| |_____^ one type is more general than the other
|
= note: while checking the return type of the `async fn`
= note: while checking the return type of the `async fn`
= note: expected opaque type `impl futures::Future`
found opaque type `impl futures::Future`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
error: could not compile `ipfs`
To learn more, run the command again with --verbose.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment