4 ms·
> Under the current regime this is not a breaking change It is. It would not be if the original `Point` definition was annotated with the `#[non_exhaustive]` a
by Georgelemental 4y ago
> Under the current regime this is not a breaking change
It is. It would not be if the original `Point` definition was annotated with the `#[non_exhaustive]` attribute.
Or actually, that still wouldn't be enough, because the new definition introduces a lifetime parameter. You could call the new definition `struct NewPoint` and introduce a `type Point = NewPoint<'static>` alias to preserve backward compatibility.
- deleted 4y ago[deleted]
- vlovich123 4y agoTIL. I’ve not seen this annotation on any rust crates I’ve looked at. Might have missed it of course but this feels like a niche annotation and everyone relies on semver instead.
- saghm 4y ago#[non_exhaustive] didn't get stabilized for downstream use until several years after Rust 1.0, which probably is why it isn't super commonly seen in the wild still, but I think the standard library has been using it since 1.0 for things like `std::io::ErrorKind`.