-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible back-compat hazard from empty structs in std #22949
Comments
Of those the only publicly exposed variants on the path to stabilization are:
Of these, most are actually intended to be empty structs, and there are only two which I would consider for modification:
I personally think it's ok for |
Thanks @huonw!
|
triage: P-backcompat-libs (1.0 beta) |
Hm, if data-less |
I've personally tried to ensure that all errors which may contain contextual information to always have a private field to prevent construction, but in the case of errors like |
Hm, I just realized this was the case, from #22122. I wish this was less painful to fix :-/ |
I suppose both this and #22045 are both particular instances of a more general principle that structs with all pub fields (and all enums that contain solely such structs) are backward compatibility hazards, no? |
@pnkfelix Yes, I agree. These definitely need to be addressed before beta. |
The IP and socket address types all had `FromStr` implemented but the implementations were not marked stable, nor was the error type returned ready to be properly stabilized. This commit marks the implementations of `FromStr` as stable and also renamed the `ParseError` structure to `AddrParseError`. The error is now also an opaque structure that cannot be constructed outside the standard library. cc rust-lang#22949 [breaking-change]
The IP and socket address types all had `FromStr` implemented but the implementations were not marked stable, nor was the error type returned ready to be properly stabilized. This commit marks the implementations of `FromStr` as stable and also renamed the `ParseError` structure to `AddrParseError`. The error is now also an opaque structure that cannot be constructed outside the standard library. cc #22949 [breaking-change]
…r=aturon The IP and socket address types all had `FromStr` implemented but the implementations were not marked stable, nor was the error type returned ready to be properly stabilized. This commit marks the implementations of `FromStr` as stable and also renamed the `ParseError` structure to `AddrParseError`. The error is now also an opaque structure that cannot be constructed outside the standard library. cc rust-lang#22949 [breaking-change]
Ok, |
These are the
pub struct
s that have no data fields at all. Once stabilised these cannot ever have anything added to them, since they can currently be publicly constructed by just writing their name. We should make sure that this is the intended behaviour for each. (I'm sure many of those are not intending to be#[stable]
for 1.0, so this is probably a fairly quick audit.)cc @aturon
The text was updated successfully, but these errors were encountered: