Stream: t-compiler/wg-rls-2.0

Topic: syntax support


Alexander Regueiro (Aug 14 2019 at 00:20, on Zulip):

Hey. You guys aware of the issue with static move closures at present?

Alexander Regueiro (Aug 14 2019 at 00:23, on Zulip):

(or yield for that matter)

matklad (Aug 14 2019 at 07:02, on Zulip):

no, what are static closures?

Daniel Mcnab (Aug 14 2019 at 08:05, on Zulip):

https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/parser/expr.rs#L887-L889 discusses static closures.

Daniel Mcnab (Aug 14 2019 at 08:06, on Zulip):

It seems to be for making automatically Pinned closures?

Daniel Mcnab (Aug 14 2019 at 08:06, on Zulip):

See https://github.com/rust-lang/rust/blob/master/src/libsyntax/parse/parser/expr.rs#L1093-L1097

Daniel Mcnab (Aug 14 2019 at 08:07, on Zulip):

And https://github.com/rust-lang/rust/pull/45337

Daniel Mcnab (Aug 14 2019 at 08:10, on Zulip):

I must say that I have never seen that syntax before, and it feels like it has been superceded by Pin. @Zoxc seems to have made that PR - can you shed any more light?

Zoxc (Aug 14 2019 at 08:14, on Zulip):

static is for immovable generators (used for async), while leaving it off gives a regular movable generator

Daniel Mcnab (Aug 14 2019 at 08:17, on Zulip):

I didn't even know we had immovable types still - I thought that was all supplanted by Pin

Daniel Mcnab (Aug 14 2019 at 08:18, on Zulip):

I thought I understood it, but perhaps I don't :P. It is very subtle

Zoxc (Aug 14 2019 at 08:20, on Zulip):

Generators without the statickeyword implements Unpin, the ones with it do not.

Daniel Mcnab (Aug 14 2019 at 08:23, on Zulip):

Oh no! I've just lost all my understanding of how you can't just create a Pin, then let the pin drop and use the reference again.

Daniel Mcnab (Aug 14 2019 at 08:23, on Zulip):

Not that's it's your job to try and teach me.

Daniel Mcnab (Aug 14 2019 at 08:31, on Zulip):

Oh never mind, making a Pin from an &mut is unsafe.

Daniel Mcnab (Aug 14 2019 at 08:31, on Zulip):

Mischief managed.

Daniel Mcnab (Aug 14 2019 at 09:15, on Zulip):

Thanks @Zoxc! I guess we need to clarify our unstable syntax tracking. Perhaps we are at a point where we can add support for #![feature] crate attributes

Alexander Regueiro (Aug 21 2019 at 15:09, on Zulip):

Ah right. Would be good to document this syntax more. It's not in the Unstable Book, is it @Zoxc ?

Last update: Nov 12 2019 at 15:30UTC