Stream: t-lang

Topic: Raw reference macros


ecstatic-morse (May 18 2020 at 19:59, on Zulip):

Unbeknownst to me, RalfJ has already opened #72279, which exposes two unstable macros, raw_ref and raw_ref_mut at the top level. They expand to the unstable &raw const and &raw mut syntax. I think any discussion of the specifics can occur on that PR.

nikomatsakis (May 18 2020 at 21:26, on Zulip):

@ecstatic-morse @RalfJ I was going to make an fcp merge, but I was wondering what you two think of this write-up?

nikomatsakis (May 18 2020 at 21:26, on Zulip):

Does it capture the key concerns?

ecstatic-morse (May 18 2020 at 21:33, on Zulip):

Looks good to me! What's up with the casing of "CAPABILITIES"?

nikomatsakis (May 18 2020 at 21:39, on Zulip):

heh I don't know

nikomatsakis (May 18 2020 at 21:39, on Zulip):

emphasis

nikomatsakis (May 18 2020 at 21:39, on Zulip):

doesn't seem necessary :)

RalfJ (May 19 2020 at 08:02, on Zulip):

@ecstatic-morse sorry if I stepped on your toes here, I wasn't aware you had plans in this area.

RalfJ (May 19 2020 at 08:02, on Zulip):

@nikomatsakis re: your write-up

"and that is not UB"

until the pointer is actually dereferenced

ecstatic-morse (May 19 2020 at 16:04, on Zulip):

Nothing like that. My action item from the meeting was to ask @RalfJ to open this exact PR.

nikomatsakis (May 19 2020 at 23:32, on Zulip):

did a rfcbot fcp merge, so @T-lang members should go check it out :)

Josh Triplett (May 19 2020 at 23:34, on Zulip):

:+1:

Josh Triplett (May 19 2020 at 23:34, on Zulip):

I hope to see an offsetof! based on these, once they're available. :)

RalfJ (May 20 2020 at 06:49, on Zulip):

ecstatic-morse said:

Nothing like that. My action item from the meeting was to ask RalfJ to open this exact PR.

ah, I clearly foresaw that then :D

RalfJ (May 20 2020 at 06:49, on Zulip):

Josh Triplett said:

I hope to see an offsetof! based on these, once they're available. :)

I'll adjust the memoffset crate once this is stable. Or do you mean in libcore?

Josh Triplett (May 20 2020 at 07:08, on Zulip):

I'd like to see it in core eventually, but in the short term, I'd just like to see a version of offsetof with no UB.

Last update: Jun 05 2020 at 22:25UTC