-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Breakage related to default field values (RFC 3681) #993
Comments
cc @estebank in case any SemVer edge cases I didn't notice jump out at you. No worries if you're too swamped with other work, just wanted to make you aware of this issue and give you the option to take a look! I like this feature and I'd like cargo-semver-checks support for it to be top-notch 😇 |
Would you have thoughts about changing from one one way of producing the value to another while the value itself doesn't change? Like struct S {
a: usize = 42,
} to struct S {
a: usize = S::A,
}
impl S {
const A: usize = 42;
} |
Changing only how the value is produced doesn't seem breaking to me. I can't think of a "witness" program that demonstrates the breakage by working fine on one version and breaking on the next. Is there a case where you think this might be breaking? |
You can check if the
No, it was just something that came to mind and I don't know what I don't know :) |
Thank you! We do use |
RFC link; Tracking issue (not for discussion, just tracking): rust-lang/rust#132162
In short:
Desirable SemVer major, deny by default lints:
{ .. }
syntax now requires supplying a value for that field.Default
, sinceDefault
doesn't matter{ .. }
-style construction.Desirable SemVer major, warn by default lints:
Default::default()
to a different, explicitly-specified valueimpl Default
on the struct/enum is derived (hand-impls might not use theDefault::default()
for the field!), and also need to determine whatDefault::default()
would return for the field's type.Default::default()
isn'tconst
in general, so we'd probably have to hardcode defaults for common built-in types.Progress:
trustfall-rustdoc-adapter
The text was updated successfully, but these errors were encountered: