Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upGoal: Accept partial initialization + use of records created via such #54987
Comments
This was referenced Oct 11, 2018
Closed
This comment has been minimized.
This comment has been minimized.
leonardo-m
commented
Oct 11, 2018
If there's an invariant of the struct fields you can't use one struct field before all of them are initialized. |
Havvy
added
T-lang
and removed
T-lang
labels
Oct 11, 2018
This comment has been minimized.
This comment has been minimized.
|
I think @leonardo-m 's previous comment is meant to be an argument against accepting the code snippet they quoted. Here are my main responses to that:
|
pnkfelix
added
the
A-NLL
label
Oct 11, 2018
Centril
added
the
T-lang
label
Oct 11, 2018
pnkfelix
added
the
NLL-deferred
label
Oct 16, 2018
This comment has been minimized.
This comment has been minimized.
|
tagging as NLL-deferred because we know we aren't going to try to implement this as part of the 2018 edition. |
pnkfelix
referenced this issue
Oct 17, 2018
Merged
reject partial init and reinit of uninitialized data #54941
This was referenced Nov 10, 2018
rkruppe
referenced this issue
Nov 22, 2018
Closed
Unconditionally fully initialized variable errors with possibly uninitialized #56159
This comment has been minimized.
This comment has been minimized.
|
@Centril has an in-progress draft of an RFC here: Centril/rfcs#16 |
This comment has been minimized.
This comment has been minimized.
|
Re-triaging for #56754. P-low since any change here deserves a (currently "unwritten" or at least unposted) RFC. |
pnkfelix
added
P-low
and removed
NLL-deferred
labels
Dec 21, 2018
matthewjasper
added
the
NLL-complete
label
Jan 19, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
pnkfelix commentedOct 11, 2018
•
edited
Spawned off of #21232
In the long-term, we want to accept code like this:
We probably also want to start accepting this too:
(But that second example is more debatable. I don't think there's any debate about the first example.)
See #54986 for the short-term goal of rejecting all partial initializations until we can actually use the results you get from partial initialization.