hobofan / ambassador

Delegation of trait implementations via procedural macros
Apache License 2.0
251 stars 13 forks source link

Strange behaviour with `BoxFuture` #16

Open hobofan opened 4 years ago

hobofan commented 4 years ago

Not sure what is going on here. Might by related to type aliases?

Error output:

error[E0308]: mismatched types
  --> rlay-client/src/backend/mod.rs:86:17
   |
86 | #[derive(Clone, Delegate)]
   |                 ^^^^^^^^ expected struct `std::pin::Pin`, found opaque type
   |
   = note: expected type `std::pin::Pin<std::boxed::Box<dyn failure::core::future::future::Future<Output = std::result::Result<std::vec::Vec<rlay_ontology::ontology::Entity>, failure::Error>> + std::marker::Send>>`
              found type `impl failure::core::future::future::Future`
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to previous error

Commit to reproduce: https://github.com/rlay-project/rlay-client/tree/0206c120b137cdc94bebaa6c751b8f663cbc9158

hobofan commented 4 years ago

This can be traced down to the get_entities function of the trait. Not sure why though, as there doesn't seem to be any noticeable difference to any of the other functions, which work without problems. 🤔