-
Notifications
You must be signed in to change notification settings - Fork 4
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
[DRAFT] RFC: Gradual struct initialization #16
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some work TODO!
The RFC has two main motivations. | ||
TODO: improve section prelude. | ||
|
||
## Ergonomics and readability (TODO: concretize the title) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @pnkfelix & @nikomatsakis
[motivation]: #motivation | ||
|
||
The RFC has two main motivations. | ||
TODO: improve section prelude. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @pnkfelix & @nikomatsakis
|
||
## Ergonomics and readability (TODO: concretize the title) | ||
|
||
TODO: Felix and/or Niko: please fill in this section :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @pnkfelix & @nikomatsakis
|
||
There are no changes to the grammar. | ||
|
||
## Semantics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pnkfelix & @nikomatsakis: also please review this section so that it makes sense to you and reflects the guide section / or if not let's make it do so...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @RalfJung so I "get a place in the queue of stuff" Ralf has to review. =P
I think the RFC should explain what is old behavior, what is making behavior consistent with a similar case and what is really new. For example, nothing in "Definitive initialization and usage" is new AFAIK, this is already how we treat local variables (when they are not fields). Basically, most of this RFC makes it so that fields of a struct behave even more like local variables behave already. That's great, I think we should do that! It should be clear which part goes beyond that, if any. Conversely, the normative text of the RFC should apply to struct fields and locals alike, to make it clear that behavior is consistent after this RFC gets accepted. The part that (seems to me) goes beyond this is the part about self-referential structs. Is that really as simple as the RFC makes it sound? Will this require dedicated support in NLL or so, or does it just fall out of everything else?
Actually I'd argue it does the opposite: We already cannot move out of fields of a Since this concerns code that is automatically inserted by the compiler (drop glue), which can already sometimes be hard to reason about, I'd say let us be careful here and not make this any more complicated than it already is. |
Will do.
I'll try to make this clearer. :) Should be fairly easy as the self referential struct bits are somewhat separate textually.
I could be wrong but it seems to me that it is really mostly a syntactic restriction that is being lifted and that NLL/polonius already supports this, but I could be wrong! This seems like an excellent bit for @pnkfelix and @nikomatsakis to elaborate upon and fill in in the RFC. =P
Right so the idea is that restrictions around I would be glad to integrate any textual changes you propose that improves on nuance here. |
I'd just add a sentence when |
Remove LocalWaker and simplify the RawWakerVTable
I just stumbled upon this beautiful RFC. It feels like a natural extension of existing features, shall we resuscitate it? |
@Nadrieril Feel free to finish the draft :) |
Rendered
This is a draft version of an RFC for you to review, before a formal proposal is made for consideration.
r? @pnkfelix @nikomatsakis -- I have left some TODOs for you to fill in... :)
note to self: squash the commits before publishing!