Closed Bromeon closed 2 years ago
My first instinct would be to avoid adding #[non_exhaustive]
to structs unless we also give them constructors.
My first instinct would be to avoid adding
#[non_exhaustive]
to structs unless we also give them constructors.
Good point. I would expect the typical usage is to read those structs (from a parsed result), but there may be use cases where people create them (for testing, or local manipulation).
I removed #[non_exhaustive]
from TyDefinition
. I guess it's OK to have small breaking API changes every now and then, as we're still in 0.x.
Parses traits, largely reusing the
impl
implementation. I added code toparse_impl.rs
, didn't have a new good name for the file, so I left it for now...Unfortunately this introduces a breaking change, because existing
TyDefinition
did not account for: Bounds
and optional= initializer
. In general, we should probably mark everything#[non_exhaustive]
to at least have the option to add fields in non-breaking ways.But no urgency from my side for any release, just thought I'd implement this while I'm in the flow 😉