greyblake / nutype

Rust newtype with guarantees πŸ‡ΊπŸ‡¦ πŸ¦€
MIT License
1.4k stars 23 forks source link

Show better error message on attempt to derive From and TryFrom #147

Closed greyblake closed 3 months ago

greyblake commented 3 months ago

At the moment attempt to derive both From and TryFrom leads to generated code that does not compile. TryFrom already has a blanket implementation though From.

When there is no validation

We want to spit out an error message that says that derive both From and TryFrom at the same moment does not make sense

When there is validation

There must be an error message that says that deriving From is not possible. It's expected to be the case already but please double check