StoicDeveloper / mapped_futures

A Rust library for mapping keys for futures, running the futures out of order, and retreiving or stopping them by their key.
GNU General Public License v3.0
4 stars 2 forks source link

No longer builds with futures-rs 0.3.31 #8

Closed awused closed 1 hour ago

awused commented 3 days ago

There was a breaking soundness fix in 0.3.31, seems like it's not a trivial fix. https://github.com/rust-lang/futures-rs/pull/2830


error[E0310]: the parameter type `K` may not live long enough
   --> src/mapped_futures/task.rs:104:9
    |
104 |         waker_ref(this)
    |         ^^^^^^^^^^^^^^^
    |         |
    |         the parameter type `K` must be valid for the static lifetime...
    |         ...so that the type `K` will meet its required lifetime bounds
    |
help: consider adding an explicit lifetime bound
    |
101 | impl<K: Hash + Eq + 'static, Fut> Task<K, Fut> {
    |                   +++++++++

FuturesUnordered had to make a copy of WakerRef without static bounds https://github.com/rust-lang/futures-rs/pull/2830/files#diff-4749c3509fed684159acdaa05f4c30240798a7c201aaa5ecc0e25641b4b6b9d6

Meisterian commented 3 days ago

I have added a PR today that may fix this issue: https://github.com/StoicDeveloper/mapped_futures/pull/7

StoicDeveloper commented 1 hour ago

resolved https://github.com/StoicDeveloper/mapped_futures/pull/7