cornucopia icon indicating copy to clipboard operation
cornucopia copied to clipboard

Use GAT to live our Query API dream

Open Virgiel opened this issue 3 years ago • 3 comments

This is an experimental PR showing how the soon-to-be-stabilisedGAT feature can help us generate less code.

Virgiel avatar Jun 12 '22 16:06 Virgiel

I think GATs also stabilize async in traits? That way we could remove our dependency on async_trait A lot of improvements!

LouisGariepy avatar Jun 12 '22 17:06 LouisGariepy

There seems to be some uncertainty about the stabilization. I really hope it goes through :sweat_smile: .

LouisGariepy avatar Jun 22 '22 20:06 LouisGariepy

:tada: GATs have been merged :) Barring some further issues, I think that means we can expect them on stable in about 3 months or so.

LouisGariepy avatar Sep 13 '22 13:09 LouisGariepy

Unfortunately, this solution has reached a dead end. The orphan rule prevents us from generating the Borrow trait for types from other crates. The truth is that we don't need GAT, it would not improve performance or compile time. If we want to make the generated code smaller or easier to read, we can always use macro_rules to de-duplicate the code generation.

Virgiel avatar Nov 01 '22 00:11 Virgiel