Skip to content

Instantly share code, notes, and snippets.

@jberkenbilt
Created November 30, 2024 13:51
Show Gist options
  • Save jberkenbilt/85e69385c5cf593e25000b3fbeb902de to your computer and use it in GitHub Desktop.
Save jberkenbilt/85e69385c5cf593e25000b3fbeb902de to your computer and use it in GitHub Desktop.
Go to Rust: 02 compiler error
error[E0308]: mismatched types
--> device/src/lib.rs:51:5
|
51 | run_method(Controller::one, val)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected opaque type `impl for<'a> Future<Output = Result<i32, Box<(dyn std::error::Error + Send + Sync + 'static)>>>`
found opaque type `impl Future<Output = Result<i32, Box<(dyn std::error::Error + Send + Sync + 'static)>>>`
= help: consider `await`ing on both `Future`s
= note: distinct uses of `impl Trait` result in different opaque types
note: the lifetime requirement is introduced here
--> device/src/lib.rs:32:39
|
32 | FnT: FnOnce(&Controller, ArgT) -> Fut,
| ^^^
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment