this post was submitted on 10 Jun 2023
10 points (100.0% liked)

Rust Lang

9 readers
1 users here now

Rules [Developing]

Observe our code of conduct

Constructive criticism only

No endless relitigation

No low-effort content

No memes or image macros

No NSFW Content

founded 1 year ago
MODERATORS
 

I have so far transformed two crates that have iterable-like properties in traits from using HRTBs to GATs. And I was seriously surprised how easy it was. The compiler gave me all the hints I needed to make everything compile. And there were only minor changes required, like removing lifetime arguments from traits or changing the type definition in trait implementations.

I wonder, has anyone encountered any difficulties when transforming their code from HRTBs to GATs?

you are viewing a single comment's thread
view the rest of the comments
[–] chrysn@chaos.social 1 points 1 year ago

@Sibbo It's been a wild ride ridden with back-and-forths about where where Self: 'a goes and whether it's needed, but that's largely past (now that it's stable), and my use case (the coap-message crate) works fine with it.