Skip to content

Commit

Permalink
Combining HRTBs with associated types
Browse files Browse the repository at this point in the history
I'm working on data-parallelism library, heavily inspired by Rayon but focused on describing certain computations on a dataset in an SQL-like manner, somewhat akin to Diesel.

One part of this combines HRTBs with associated types. I've bumped into a few issues that have made things a bit tricky ([#30472](rust-lang/rust#30472), [#30867](rust-lang/rust#30867), [#53943](rust-lang/rust#53943), and similar), the hardest to work around however has been that I don't believe it's currently possible to write this:
```rust
type Task = for<'a> <B as Abc<&'a A::Item>>::Task;
```
Currently I've resorted to a dummy trait, manually reimplemented on various structs without the reference, such that I can do:
```rust
type Task = <B as AbcDummy<A::Item>>::Task;
```
and (horribly) transmute between the two.

I'd be very interested to discuss

 1) issues I've bumped into combining HRTBs and associated types;
 2) how to get rid of this transmute and the dummy trait;
 3) any feedback on the library before I publish and promote it, given it's heavily inspired by your work on Rayon!

I can do any of the Monday or Friday times listed, though I have a preference for the 16 - 16.30 slots.

Again, much appreciation for you doing this, I think it's awesome!
  • Loading branch information
alecmocatta authored Sep 13, 2018
1 parent 16191c8 commit b5c6127
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion 2018/09.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ Unassigned.
Level: Any
Time: 16 - 16:30 (UTC-4)

Unassigned.
Alec Mocatta – Combining HRTBs with associated types<br/>
(preferred) Email: alec@mocatta.net<br/>
Discord: alecmocatta#8569<br/>
Twitter: [@alecmocatta](https://twitter.com/alecmocatta)

**Monday, Sep 24.**

Expand Down

0 comments on commit b5c6127

Please sign in to comment.