lloydmeta / frunk

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

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

Open lloydmeta opened 4 months ago

lloydmeta commented 4 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