Stream: wg-async-foundations

Topic: weekly meeting 2019.04.23


Taylor Cramer (Apr 23 2019 at 16:57, on Zulip):

o/ @WG-async-await

tmandry (Apr 23 2019 at 16:57, on Zulip):

I won't be around for all of the normal meeting time today. Status on generator optimizations is:
#59897 is cleaned up waiting for review (and a test fix)
I also opened #60187 which is the actual optimization so we can test the performance

Taylor Cramer (Apr 23 2019 at 16:58, on Zulip):

There's a new issue that was just opened recently: https://github.com/rust-lang/rust/issues/60203

Taylor Cramer (Apr 23 2019 at 16:59, on Zulip):

I believe this is due to how the shared code with elision in impl headers doesn't allow elided lifetime parameters that are non-explicit

Taylor Cramer (Apr 23 2019 at 16:59, on Zulip):

(in non-reference types)

Taylor Cramer (Apr 23 2019 at 17:00, on Zulip):

@nikomatsakis I don't believe there's an obvious fix for this that doesn't involve moving all of that code into a different part of the compiler

Taylor Cramer (Apr 23 2019 at 17:00, on Zulip):

but we might be able to detect and warn about this case somewhere-- WDYT?

Taylor Cramer (Apr 23 2019 at 17:00, on Zulip):

I'll label as blocking for now.

Taylor Cramer (Apr 23 2019 at 17:00, on Zulip):

(unless anyone objects)

nikomatsakis (Apr 23 2019 at 17:01, on Zulip):

ok, let me look for a second

Taylor Cramer (Apr 23 2019 at 17:02, on Zulip):

I also finished up work on the syntax implementation, which fixes several of the other outstanding issues.

Taylor Cramer (Apr 23 2019 at 17:02, on Zulip):

and I left a comment to that effect on https://github.com/rust-lang/rust/issues/60016

nikomatsakis (Apr 23 2019 at 17:02, on Zulip):

I'll label as blocking for now.

one simple option is to make "hidden lifetimes" mandatory in async fns :)

nikomatsakis (Apr 23 2019 at 17:02, on Zulip):

that said, I feel like this level of desugaring happens at HIR lowering time

Taylor Cramer (Apr 23 2019 at 17:02, on Zulip):

@nikomatsakis oh? how would we know by HIR which external types contain lifetimes and which don't?

nikomatsakis (Apr 23 2019 at 17:03, on Zulip):

I also finished up work on the syntax implementation, which fixes several of the other outstanding issues.

I was going to mention this -- well, let me read your comment first

nikomatsakis (Apr 23 2019 at 17:03, on Zulip):

oh? how would we know by HIR which external types contain lifetimes and which don't?

we've resolved names already

Taylor Cramer (Apr 23 2019 at 17:03, on Zulip):

my comment doesn't have a lot more info

nikomatsakis (Apr 23 2019 at 17:03, on Zulip):

indeed, it does not :)

Taylor Cramer (Apr 23 2019 at 17:04, on Zulip):

Specifically, https://github.com/rust-lang/rust/issues/51719 and https://github.com/rust-lang/rust/issues/51751 are fixed

Taylor Cramer (Apr 23 2019 at 17:04, on Zulip):

I did hit one funny issue which I asked about in the help channel here

nikomatsakis (Apr 23 2019 at 17:04, on Zulip):

So, I was going to say that I think opening a PR seems "ok" to me. I think you said you chose foo.await as the syntax. If I were you, I'd open a PR with some text like


Implements built-in syntax for await

This PR implements foo.await. This is a "placeholder" choice and should not be interpreted as "blessing" that syntax, as there has been no final decision on the syntax to use. However, we had to do something and I chose to use the syntax I personally prefer (implementor's prerogative).

Taylor Cramer (Apr 23 2019 at 17:05, on Zulip):

@nikomatsakis I'd prefer not to land anything that isn't the final syntax

Taylor Cramer (Apr 23 2019 at 17:05, on Zulip):

as it's pretty huge churn for me, futures-rs, and everyone I work with

nikomatsakis (Apr 23 2019 at 17:05, on Zulip):

Why? Oh, does it also remove the macro?

Taylor Cramer (Apr 23 2019 at 17:05, on Zulip):

Yes.

nikomatsakis (Apr 23 2019 at 17:06, on Zulip):

Ah. Why do that?

nikomatsakis (Apr 23 2019 at 17:06, on Zulip):

I'd have expected the macro to lower to the syntax

nikomatsakis (Apr 23 2019 at 17:06, on Zulip):

Like, that just seems like a better transition plan period

Taylor Cramer (Apr 23 2019 at 17:06, on Zulip):

Today we turn off "await" as a keyword

Taylor Cramer (Apr 23 2019 at 17:06, on Zulip):

when async_await is enabled

nikomatsakis (Apr 23 2019 at 17:06, on Zulip):

OK, but we can special-case await !

nikomatsakis (Apr 23 2019 at 17:06, on Zulip):

i.e., the keyword followed by a bang

nikomatsakis (Apr 23 2019 at 17:07, on Zulip):

but maybe that's too much work?

Taylor Cramer (Apr 23 2019 at 17:07, on Zulip):

Yeah, we can have a special case in the parser for that

nikomatsakis (Apr 23 2019 at 17:07, on Zulip):

I feel like it'd be nice if people could move their code "bit by bit" rather than one huge PR

Taylor Cramer (Apr 23 2019 at 17:07, on Zulip):

not that much work, but I figured it wasn't something we wanted to do

Taylor Cramer (Apr 23 2019 at 17:07, on Zulip):

^^it would be nice

Taylor Cramer (Apr 23 2019 at 17:07, on Zulip):

I guess I'm used to that kind of churn around e.g. futures_api

Taylor Cramer (Apr 23 2019 at 17:07, on Zulip):

but certainly it would be more convenient another way

nikomatsakis (Apr 23 2019 at 17:07, on Zulip):

Up to you

nikomatsakis (Apr 23 2019 at 17:08, on Zulip):

but I agree we should not force people to migrate twice

Taylor Cramer (Apr 23 2019 at 17:08, on Zulip):

okay, I can give it a shot then

Taylor Cramer (Apr 23 2019 at 17:08, on Zulip):

right

Taylor Cramer (Apr 23 2019 at 17:08, on Zulip):

I kind of feel like it should be under a separate feature gate

Taylor Cramer (Apr 23 2019 at 17:08, on Zulip):

I'll play with it :)

nikomatsakis (Apr 23 2019 at 17:08, on Zulip):

yeah

nikomatsakis (Apr 23 2019 at 17:08, on Zulip):

that..probably makes sense

nikomatsakis (Apr 23 2019 at 17:09, on Zulip):

if it's easy to do, at least

Taylor Cramer (Apr 23 2019 at 17:09, on Zulip):

mhm

nikomatsakis (Apr 23 2019 at 17:09, on Zulip):

ok, so, I guess that you've not done anything on the regin solving, right?

Taylor Cramer (Apr 23 2019 at 17:09, on Zulip):

I have not

nikomatsakis (Apr 23 2019 at 17:09, on Zulip):

I actually have .. a bit more time this week, and I might be able to devote some time to that

nikomatsakis (Apr 23 2019 at 17:09, on Zulip):

I wouldn't mind playing around with it if I can carve out the time

Taylor Cramer (Apr 23 2019 at 17:10, on Zulip):

okay-- let me know if you're feeling pressed for time still, because I have time to look this week

Taylor Cramer (Apr 23 2019 at 17:10, on Zulip):

both https://github.com/rust-lang/rust/issues/59313 and https://github.com/rust-lang/rust/issues/59972 have PRs out to fix

Taylor Cramer (Apr 23 2019 at 17:10, on Zulip):

as does https://github.com/rust-lang/rust/issues/58930

Taylor Cramer (Apr 23 2019 at 17:11, on Zulip):

and https://github.com/rust-lang/rust/issues/54716

nikomatsakis (Apr 23 2019 at 17:11, on Zulip):

and https://github.com/rust-lang/rust/issues/54716

looks like @Giles Cope did the work I asked for, or at least rebased :)

Taylor Cramer (Apr 23 2019 at 17:11, on Zulip):

so that just leaves multiple lifetimes and unbounded recursion

nikomatsakis (Apr 23 2019 at 17:11, on Zulip):

I've been very slow in reviewing lately :(

nikomatsakis (Apr 23 2019 at 17:11, on Zulip):

but I can look at that now-ish

nikomatsakis (Apr 23 2019 at 17:11, on Zulip):

(ps @Giles Cope please feel free to mercilessly ping me)

davidtwco (Apr 23 2019 at 17:12, on Zulip):

After addressing @Taylor Cramer's feedback on the drop order PR, I can take on another task.

Giles Cope (Apr 23 2019 at 17:12, on Zulip):

thanks just need to figure out how to tell rust that the doc code snipit is 2018 rust...

Taylor Cramer (Apr 23 2019 at 17:12, on Zulip):

one of us should probably investigate the unbounded recursion issue, then: https://github.com/rust-lang/rust/issues/53249

Taylor Cramer (Apr 23 2019 at 17:12, on Zulip):

want to take that one @davidtwco ?

davidtwco (Apr 23 2019 at 17:13, on Zulip):

Sure thing.

Taylor Cramer (Apr 23 2019 at 17:13, on Zulip):

oh so we sort of moved on without settling https://github.com/rust-lang/rust/issues/60203 @nikomatsakis

Taylor Cramer (Apr 23 2019 at 17:13, on Zulip):

I'd be happy to go in and investigate that

Taylor Cramer (Apr 23 2019 at 17:14, on Zulip):

but you'd prefer not to add support for impl headers as well? at the moment it's shared code

nikomatsakis (Apr 23 2019 at 17:14, on Zulip):

thanks just need to figure out how to tell rust that the doc code snipit is 2018 rust...

hmm =) maybe @Guillaume or @QuietMisdreavus knows

nikomatsakis (Apr 23 2019 at 17:15, on Zulip):

but you'd prefer not to add support for impl headers as well? at the moment it's shared code

say more @Taylor Cramer ?

nikomatsakis (Apr 23 2019 at 17:15, on Zulip):

Oh, i.e., the way that -- in an impl header -- it is presently a hard error to elide the '_

nikomatsakis (Apr 23 2019 at 17:16, on Zulip):

Is that what you're referring to?

Taylor Cramer (Apr 23 2019 at 17:16, on Zulip):

Yes-- they both use https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L305

nikomatsakis (Apr 23 2019 at 17:16, on Zulip):

I don't really have a strong opinion here. I'd be happy to make it a hard error to elide the '_ in an async fn as well :)

nikomatsakis (Apr 23 2019 at 17:16, on Zulip):

but I'm also ok with it being permitted (but deprecated) in both

nikomatsakis (Apr 23 2019 at 17:16, on Zulip):

(i.e., that I guess makes it more uniform across the whole lang)

Taylor Cramer (Apr 23 2019 at 17:17, on Zulip):

today it looks like we create a parameter specifically when we lower a lifetime with the name '_

Taylor Cramer (Apr 23 2019 at 17:17, on Zulip):

https://github.com/rust-lang/rust/blob/master/src/librustc/hir/lowering.rs#L2549

Taylor Cramer (Apr 23 2019 at 17:17, on Zulip):

so that would have to change up a bit if we wanted to support this

Taylor Cramer (Apr 23 2019 at 17:17, on Zulip):

I don't have a really strong opinion either way

Taylor Cramer (Apr 23 2019 at 17:18, on Zulip):

but it would be nice for the two to match purely from an implementation standpoint

nikomatsakis (Apr 23 2019 at 17:18, on Zulip):

but it would be nice for the two to match purely from an implementation standpoint

I agree with this

nikomatsakis (Apr 23 2019 at 17:18, on Zulip):

so that would have to change up a bit if we wanted to support this

yeah, I think that might have been a partial motivator for why I made it a hard error

nikomatsakis (Apr 23 2019 at 17:18, on Zulip):

I feel like making it a hard error seems ok -- I'm a bit confused why, if they are shared code, it is not already?

nikomatsakis (Apr 23 2019 at 17:18, on Zulip):

I guess because it's not setting the right flag

QuietMisdreavus (Apr 23 2019 at 17:19, on Zulip):

tag doctests with edition2018 to force them to build as 2018

nikomatsakis (Apr 23 2019 at 17:19, on Zulip):

@Giles Cope :point_up:

QuietMisdreavus (Apr 23 2019 at 17:19, on Zulip):

though there may be issues with certain edition things, there’s an open PR to fix it but it’s hit another issue

Taylor Cramer (Apr 23 2019 at 17:20, on Zulip):

@nikomatsakis okay, I'll make it a hard error for now, then, and we can always add support later if we decide to

nikomatsakis (Apr 23 2019 at 17:20, on Zulip):

I feel like making it a hard error seems ok -- I'm a bit confused why, if they are shared code, it is not already?

ps I guess this is one of those "small decisions" that comes up during impl where it'd be nice to have a clearer place to surface it

Giles Cope (Apr 23 2019 at 17:20, on Zulip):

ok will give that a try. didn't see many examples

nikomatsakis (Apr 23 2019 at 17:21, on Zulip):

@Taylor Cramer you looked for new issues already, right? (hence the one we're discussing now)

nikomatsakis (Apr 23 2019 at 17:21, on Zulip):

Is there anything left at this point?

nikomatsakis (Apr 23 2019 at 17:21, on Zulip):

(i.e., for this meeting)

Taylor Cramer (Apr 23 2019 at 17:21, on Zulip):

I did-- I didn't see any other untriaged ones

nikomatsakis (Apr 23 2019 at 17:23, on Zulip):

@davidtwco do you feel you need another task this week =)

nikomatsakis (Apr 23 2019 at 17:23, on Zulip):

okay-- let me know if you're feeling pressed for time still, because I have time to look this week

ps @Taylor Cramer I scheduled a big block of time tomorrow, but I'll update you then how it goes -- or earlier if I decide I have too much going on.

davidtwco (Apr 23 2019 at 17:24, on Zulip):

:confounded: I don't get it..

centril (Apr 23 2019 at 17:27, on Zulip):

@nikomatsakis @Taylor Cramer nominated the '_ issue for Thursday

Taylor Cramer (Apr 23 2019 at 17:32, on Zulip):

okay-- that's all I have for this week

GuillaumeGomez (Apr 23 2019 at 17:51, on Zulip):

hmm =) maybe @Guillaume or @QuietMisdreavus knows

I don't have the original message so I'll just assume you're talking about long error code explanation? If so, there is one I kinda enforced but not sure if still followed:

Description of the error.

[code example(s) showing a failing case]

Explanations of why it's failing and how to fix it.

[fixed code example(s)]

If I was wrong, please correct so I can answer. :)

QuietMisdreavus (Apr 23 2019 at 17:54, on Zulip):

it was about using a specific edition in a doctest

QuietMisdreavus (Apr 23 2019 at 17:54, on Zulip):

i answered earlier

Last update: Nov 18 2019 at 02:15UTC