lloydmeta / frunk

Funktional generic type-level programming in Rust: HList, Coproduct, Generic, LabelledGeneric, Validated, Monoid and friends.
https://beachape.com/frunk/
MIT License
1.29k stars 58 forks source link

Use diagnostic::on_unimplemented to make compile errors more helpful and less intimidating #231

Open lloydmeta opened 6 months ago

lloydmeta commented 6 months ago

Right now, compile-time errors on transmogrify can be truly terrifying and unhelpful.

The new #[diagnostic::on_unimplemented] attribute from 1.78.0 might be helpful here.

That said, much of the functionality around LabelledGeneric and friends are built on top of smaller, more basic traits, which are based on other traits.... so I'm not really sure how far we can really go. Worth a think though.

https://github.com/lloydmeta/frunk/blob/1ca9c995b966ef204accd6b992401acfec302500/core/src/labelled.rs#L829-L911