Stream: wg-async-foundations

Topic: meeting 2019.10.15


nikomatsakis (Oct 15 2019 at 17:08, on Zulip):

Hey @WG-async-foundations =) I'm running late today, but meeting?

nikomatsakis (Oct 15 2019 at 17:09, on Zulip):

First, review uncategorized issues

Giles Cope (Oct 15 2019 at 17:09, on Zulip):

https://github.com/rust-lang/rust/pull/64603 is reviewed so that should be closed out tonight. :-)

nikomatsakis (Oct 15 2019 at 17:09, on Zulip):

Attempting to run an async fn after completion mentions generators #65419

nikomatsakis (Oct 15 2019 at 17:09, on Zulip):

thread 'main' panicked at 'generator resumed after completion', src/main.rs:1:16

nikomatsakis (Oct 15 2019 at 17:10, on Zulip):

seems suboptimal but also kind of "meh" to me

nikomatsakis (Oct 15 2019 at 17:10, on Zulip):

otoh maybe very easy to fix

nikomatsakis (Oct 15 2019 at 17:10, on Zulip):

worth putting as "on deck"?

nikomatsakis (Oct 15 2019 at 17:10, on Zulip):

(that's the only untriaged issue)

nikomatsakis (Oct 15 2019 at 17:11, on Zulip):

worth putting as "on deck"?

I'm going to leave it

centril (Oct 15 2019 at 17:11, on Zulip):

@Giles Cope retried that PR cause spurious network stuff

nikomatsakis (Oct 15 2019 at 17:12, on Zulip):

actually I wonder where that error message comes from

nikomatsakis (Oct 15 2019 at 17:12, on Zulip):

a quick ripgrep didn't find it

centril (Oct 15 2019 at 17:12, on Zulip):

@nikomatsakis feels like a good thing to fix I think

centril (Oct 15 2019 at 17:12, on Zulip):

feels like polish-worthy and possible to hit

nikomatsakis (Oct 15 2019 at 17:13, on Zulip):

ok, I nominated it for on on-deck

Giles Cope (Oct 15 2019 at 17:13, on Zulip):

maybe label with good first issue?

nikomatsakis (Oct 15 2019 at 17:13, on Zulip):

I also pinged zoxc

Nemo157 (Oct 15 2019 at 17:13, on Zulip):

it's part of the generator transform

nikomatsakis (Oct 15 2019 at 17:13, on Zulip):

to get feedback on where the error comes from

centril (Oct 15 2019 at 17:13, on Zulip):

I grepped in src/lib* for "after completion" and I cannot find it either

nikomatsakis (Oct 15 2019 at 17:13, on Zulip):

oh, I guess the Display impl must be it

centril (Oct 15 2019 at 17:13, on Zulip):

super weird

Nemo157 (Oct 15 2019 at 17:14, on Zulip):

I think it's actually very difficult to hit, I only opened it because someone implementing a custom executor somehow managed to hit it

Nemo157 (Oct 15 2019 at 17:14, on Zulip):

that's the only time I've heard of it being reached

nikomatsakis (Oct 15 2019 at 17:14, on Zulip):

Can you "await" a ref to a future

nikomatsakis (Oct 15 2019 at 17:15, on Zulip):

(similar to the by_ref adapter for iterators)

nikomatsakis (Oct 15 2019 at 17:15, on Zulip):

if so, presumably that'd make it .. oh, I guess not

centril (Oct 15 2019 at 17:15, on Zulip):

@nikomatsakis https://doc.rust-lang.org/nightly/nightly-rustc/rustc/mir/interpret/enum.PanicInfo.html#method.description

nikomatsakis (Oct 15 2019 at 17:15, on Zulip):

I was going to say that'd make it relatively easy to hit, but maybe not

csmoe (Oct 15 2019 at 17:15, on Zulip):

https://github.com/rust-lang/rust/issues/65180 update: I found the cause of the error, trying to improve the error reporting.

nikomatsakis (Oct 15 2019 at 17:15, on Zulip):

anyway, yeah, focus issues

nikomatsakis (Oct 15 2019 at 17:16, on Zulip):

so https://github.com/rust-lang/rust/issues/65159 ...

nikomatsakis (Oct 15 2019 at 17:16, on Zulip):

I opened a PR

nikomatsakis (Oct 15 2019 at 17:16, on Zulip):

I guess it just needs r+

nikomatsakis (Oct 15 2019 at 17:16, on Zulip):

it bouned in some weird way

nikomatsakis (Oct 15 2019 at 17:17, on Zulip):

non-send futures error at point of use, but could cite point of definition in some cases #64130

@davidtwco opened a WIP PR for follow-up work I think

nikomatsakis (Oct 15 2019 at 17:17, on Zulip):

Async blocks are leaky about wording wrt. ? in diagnostics #62570

any update on this @Giles Cope? I see some comments there

centril (Oct 15 2019 at 17:17, on Zulip):

@nikomatsakis r=cramertj ^^

nikomatsakis (Oct 15 2019 at 17:18, on Zulip):

thanks :)

Giles Cope (Oct 15 2019 at 17:18, on Zulip):

getting there - realised I needed to switch out the stage 0 compiler to achieve it

nikomatsakis (Oct 15 2019 at 17:18, on Zulip):

oh?

centril (Oct 15 2019 at 17:19, on Zulip):

bootstrap tricks... fun :D

Giles Cope (Oct 15 2019 at 17:19, on Zulip):

otherwise it instantly complains it can't parse the {ItemContext} even if I've changed the parsing code to show a different message

centril (Oct 15 2019 at 17:20, on Zulip):

Makes sense

Giles Cope (Oct 15 2019 at 17:20, on Zulip):

I think I need to commit the addition of ItemContext as a symbol as one PR and then reference it with another

nikomatsakis (Oct 15 2019 at 17:21, on Zulip):

I'm not sure what the ItemContext is referring to

nikomatsakis (Oct 15 2019 at 17:21, on Zulip):

is this part of the rustc_on_unimplemented attribute?

centril (Oct 15 2019 at 17:21, on Zulip):

not yet :P

nikomatsakis (Oct 15 2019 at 17:21, on Zulip):

If so, you can also do #[cfg_attr(stage0, ...)] and #[cfg_attr(not(stage0), ...)]

nikomatsakis (Oct 15 2019 at 17:21, on Zulip):

usually less annoying than bootstrapping :)

Giles Cope (Oct 15 2019 at 17:21, on Zulip):

ah neat

nikomatsakis (Oct 15 2019 at 17:21, on Zulip):

maybe we don't do that anymore

centril (Oct 15 2019 at 17:21, on Zulip):

@nikomatsakis there's no stage0

nikomatsakis (Oct 15 2019 at 17:22, on Zulip):

we used to do it all the time :P

nikomatsakis (Oct 15 2019 at 17:22, on Zulip):

yeah ok that's dated I guess

centril (Oct 15 2019 at 17:22, on Zulip):

it's called cfg_attr(bootstrap, ...) now

nikomatsakis (Oct 15 2019 at 17:22, on Zulip):

ah, ok, same idea though

centril (Oct 15 2019 at 17:22, on Zulip):

basically s/stage0/bootstrap

centril (Oct 15 2019 at 17:22, on Zulip):

yep

Giles Cope (Oct 15 2019 at 17:22, on Zulip):

cool - that's handy.

nikomatsakis (Oct 15 2019 at 17:22, on Zulip):

I'm not sure if the release team cleans those up periodically anymore?

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

if not, maybe we want a FIXME issue to track it

centril (Oct 15 2019 at 17:23, on Zulip):

@nikomatsakis we do

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

OK, so, last update I guess:

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

async/await: awaiting inside a match block captures borrow too eagerly #57017

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

I did do some investigation here into what it would take to build MIR in order to figure out what's live

nikomatsakis (Oct 15 2019 at 17:24, on Zulip):

long comment here

nikomatsakis (Oct 15 2019 at 17:24, on Zulip):

my initial conclusion was "it's hard"

nikomatsakis (Oct 15 2019 at 17:24, on Zulip):

but I plan to do some more digging

nikomatsakis (Oct 15 2019 at 17:25, on Zulip):

another, interim alternative might be to be just have a better approximation than we currently do

nikomatsakis (Oct 15 2019 at 17:26, on Zulip):

Last five minutes -- anybody looking for something to do?

nikomatsakis (Oct 15 2019 at 17:26, on Zulip):

Any final comments?

centril (Oct 15 2019 at 17:26, on Zulip):

(I'm a bit wary of hacks in MIR tho -- I'd like us to be more principled like GHC is with System FC... and MIR isn't even sound by construction :sob: -- maybe @eddyb's RVSDG would help... -- and I hear swiftc with SIL?)

nikomatsakis (Oct 15 2019 at 17:28, on Zulip):

Well, I'm not really talking about introducing hacks into MIR.

Giles Cope (Oct 15 2019 at 17:28, on Zulip):

Just want to say how nice debugging async/await is compared to in c# - it's much easier with 'truthful' stacks.

nikomatsakis (Oct 15 2019 at 17:29, on Zulip):

that's a cool benefit of the design, yeah

centril (Oct 15 2019 at 17:29, on Zulip):

@nikomatsakis Where are we adding the hacks instead? :D

nikomatsakis (Oct 15 2019 at 17:30, on Zulip):

Well it's more like replacing the hack we already have with a better hack :P

nikomatsakis (Oct 15 2019 at 17:30, on Zulip):

basically there is code that "overapproximates" what might be live across awaits in the generator

centril (Oct 15 2019 at 17:30, on Zulip):

Ah I see; well, a principled hack is better than a less principled one

Giles Cope (Oct 15 2019 at 17:31, on Zulip):

in principle...

nikomatsakis (Oct 15 2019 at 17:31, on Zulip):

An interesting observation is that if we succeed with polonius (and in particular the datalog definition thereof)

nikomatsakis (Oct 15 2019 at 17:32, on Zulip):

that maybe it makes to build the analysis data direct from HAIR or something. I've long wanted rustc_typeck to be a function that takes in "HIR" and produces something more like "HAIR". Anyway, sort of neither here nor there -- if you read the comment, one of the key problems is that MIR right now requires "all types" to be known. But some of the types in the generator can be influenced by what comes later. So we have to infer the whole function as a unit. It's kind of a sticky thing to untangle.

nikomatsakis (Oct 15 2019 at 17:33, on Zulip):

Already true for closures

nikomatsakis (Oct 15 2019 at 17:33, on Zulip):

but of course closure types don't depend on their bodies in quite the same way

nikomatsakis (Oct 15 2019 at 17:34, on Zulip):

anyway gotta go grab lunch, ttyl

Giles Cope (Oct 15 2019 at 17:34, on Zulip):

oh btw I start a new job next week. Going to be coding rust for a living.

nikomatsakis (Oct 15 2019 at 17:35, on Zulip):

that's great!

nikomatsakis (Oct 15 2019 at 17:35, on Zulip):

congratulations

Giles Cope (Oct 15 2019 at 17:35, on Zulip):

thanks - rust in finance in london is starting to be a thing.

Last update: Nov 18 2019 at 02:10UTC