TimelyDataflow / timely-dataflow

A modular implementation of timely dataflow in Rust
MIT License
3.29k stars 272 forks source link

Remove all Pusher/Puller boxing using GATs #460

Open petrosagg opened 2 years ago

petrosagg commented 2 years ago

Currently the Allocate::allocate method is hardcoded to return a (Vec<Box<dyn Push<Message<T>>>>, Box<dyn Pull<Message<T>>>) pair. Boxing was necessary because the generic T parameter was on the method.

Generic associated types is the missing piece to allow the concrete type to be spelled out and since they are right around the corner for stable Rust I went ahead and implemented it.

This PR removes every single use of a Box<dyn Puller/Pusher> instance in the codebase. It is not mergeable yet because it requires the nightly feature flag but we could discuss it and merge it once GATs are released.

petrosagg commented 2 years ago

This PR now compiles on stable!