paholg / dimensioned

Compile-time dimensional analysis for various unit systems using Rust's type system.
https://crates.io/crates/dimensioned
MIT License
300 stars 23 forks source link

Use #[rustc_on_unimplemented] #43

Open jendrikw opened 6 years ago

jendrikw commented 6 years ago

With #[rustc_on_unimplemented(mesage = "xxx", label = "xxx")], it is possible to customize error messages if an implementation for a trait is not found. Maybe this can produce better error messages.

It is available under #![feature(on_unimplemented)], which unfortunately requires nightly.

paholg commented 6 years ago

This is interesting. What I really want is a way to customize how my types are displayed in all error messages. The potential there to make things confusing is high, though, so I'm guessing this is unlikely be a feature.