Stream: t-compiler/wg-nll

Topic: #21232 borrow-checker allows partial reinit of struct tha...


pnkfelix (Oct 02 2018 at 19:48, on Zulip):

(if people want to voice opinions about the options available to us on #21232, feel free to add comments there)

Keith Yeung (Oct 02 2018 at 19:48, on Zulip):

ugh, that one is a bit annoying

Keith Yeung (Oct 02 2018 at 19:48, on Zulip):

i was asked about this on both IRC and rust china before

pnkfelix (Oct 02 2018 at 19:48, on Zulip):

@Keith Yeung about which, #21232, or #54692 ?

Keith Yeung (Oct 02 2018 at 19:48, on Zulip):

#21232

pnkfelix (Oct 02 2018 at 19:49, on Zulip):

ah. Yeah. Our current state is pretty goofy.

lqd (Oct 02 2018 at 19:49, on Zulip):

would #21232 be fiddling with our FakeReads ?

nikomatsakis (Oct 02 2018 at 19:49, on Zulip):

not really related

nikomatsakis (Oct 02 2018 at 19:49, on Zulip):

(I don't think?)

Keith Yeung (Oct 02 2018 at 19:50, on Zulip):

it appears to completely violate ownership rules

pnkfelix (Oct 02 2018 at 19:51, on Zulip):

lets maybe branch this off into a separate topic

lqd (Oct 02 2018 at 19:51, on Zulip):

the lang meeting is thursday ?

pnkfelix (Oct 02 2018 at 19:51, on Zulip):

/me will actually do so, right now

Jake Goulding (Oct 02 2018 at 23:12, on Zulip):

Everything else being equal, I'd prefer if structs / enums could be treated as "dumb containers" when I have ownership of them.

If I have a declared but undefined value and add all the fields to it, I'd like for it to work. Likewise, I'd like to be able to move a value out of it and put a new value and have it work.

Keith Yeung (Oct 02 2018 at 23:49, on Zulip):

we should be able to make a determination of whether all the fields of the struct are properly initialized before a use with our MIR borrowck

Keith Yeung (Oct 02 2018 at 23:49, on Zulip):

but perhaps the real question here is how efficient can we make this check

pnkfelix (Oct 16 2018 at 15:13, on Zulip):

Hey, I have put up an r? @nikomatsakis for PR #54941, but I suspect that others (e.g. @Santiago Pastorino ) would be reasonable alternative choices for doing the review.

pnkfelix (Oct 16 2018 at 15:14, on Zulip):

If I have a declared but undefined value and add all the fields to it, I'd like for it to work. Likewise, I'd like to be able to move a value out of it and put a new value and have it work.

I think the lang team agrees that we want to do this. See #54987. Centril told me that they are working on an RFC for it.

nikomatsakis (Oct 16 2018 at 15:41, on Zulip):

seems obvious (to me) that it should work

nikomatsakis (Oct 16 2018 at 15:47, on Zulip):

@pnkfelix left a few nits but looks great

Santiago Pastorino (Oct 16 2018 at 17:15, on Zulip):

I can also help checking this out later

Santiago Pastorino (Oct 16 2018 at 17:16, on Zulip):

I'm traveling today though

pnkfelix (Oct 16 2018 at 19:01, on Zulip):

@Santiago Pastorino okay if you get a chance to glance over it, great. But no big deal if you cannot alllocate time; I know what a bear travel can be

Last update: Nov 21 2019 at 13:20UTC