Stream: wg-async-foundations

Topic: meeting 2019.10.08


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

Hey @WG-async-foundations -- sync?

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

We've got a bunch of uncategorized issues

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

Async-related type error messages defy expectations (in span location) #65180

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

going to tag as triaged

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

not sure if we want to put it "on deck"

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

Nightly async fn ICE #65159

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

seems to be my fault

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

I guess i'll self-assign and try to investigate tomorrow

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

check_mod_item_types query times regressed bigly #65147

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

@tmandry shall I assign this to you?

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

do you need assistance?

centril (Oct 08 2019 at 17:06, on Zulip):

seems to be my fault

Ostensibly this means that we don't backport https://github.com/rust-lang/rust/pull/64999 because "risky" ?

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

plausibly, I was wondering the same

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

let's see what I come up with tomorrow I guess

centril (Oct 08 2019 at 17:06, on Zulip):

sgtm; thanks

Taylor Cramer (Oct 08 2019 at 17:07, on Zulip):

@tmandry and I are both in a meeting at work, might be unresponsive

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

ok. the only other triaged issue is

Cannot await in scope that contains call to format! #64960

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

Attempting to mutate an argument to an async fn that was not marked mut results in this error message:
cannot borrow immutable captured outer variable in an FnOnce closure sender as mutable

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

I'm going to just leave that one as "triaged"

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

I'm happy to pick up another issue. I think my one's cooked.

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

oh, great @Giles Cope -- well for now i'm going to assign #65147 to @tmandry as a "focus issue"

centril (Oct 08 2019 at 17:09, on Zulip):

@nikomatsakis I happened by https://github.com/rust-lang/rust/issues/64692 just now... I wonder if we should heed @Taylor Cramer's advice there and make it a hard error... tho I hear from @Vadim Petrochenkov that the lint is overzealous?

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

yeah, I don't know. in my opinion that rule should just go away altogether

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

(private-type-in-public-interface)

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

but that's a separate thing

centril (Oct 08 2019 at 17:10, on Zulip):

Seems like a bigger discussion :slight_smile:

centril (Oct 08 2019 at 17:10, on Zulip):

Ostensibly it's easier to go from errors to not errors

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

yes.

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

I guess we could adjust the lint to not be a FCW "iff" inside an async fn

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

not sure how hard that would be

centril (Oct 08 2019 at 17:10, on Zulip):

I'll cc Vadim on the issue and maybe they have opinions

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

ok let's check out the focus issues to start I guess

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

#65159 and #65147 we just created

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

Consider async blocks on lifetime errors #64382

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

@csmoe opened https://github.com/rust-lang/rust/pull/65166

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

it's R+'d

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

awesome!

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

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

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

@davidtwco was doing some work I know

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

don't see a fresh PR yet

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

unused-lifetimes lint false-positives with async functions #61115

Taylor Cramer (Oct 08 2019 at 17:13, on Zulip):

Didn't we already land an RFC to make private-in-public a lint rather than hard error?

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

@Giles Cope opened #64603

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

Didn't we already land an RFC to make private-in-public a lint rather than hard error?

I feel like yes

Taylor Cramer (Oct 08 2019 at 17:13, on Zulip):

It was one of @Vadim Petrochenkov 's IIRC

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

we definitely talked about it

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

yep #64603 is pending review.

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

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

Taylor Cramer (Oct 08 2019 at 17:14, on Zulip):

yeah it's https://github.com/rust-lang/rfcs/blob/master/text/2145-type-privacy.md

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

so I had self-assigned this to do some prelim exploration; I didn't get to it last week, but could plausibly do it this week. I was basically going to try to insert a call to create the MIR at the point where we compute interior types and see how badly things break

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

davidtwco was doing some work I know

I hope to have it up tonight or tomorrow.

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

I could imagine handing off that exploration, but maybe better to look first at other on-deck issues

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

yeah it's https://github.com/rust-lang/rfcs/blob/master/text/2145-type-privacy.md

@centril :point_up: not sure whether that means this whole FCW should just be removed or what

centril (Oct 08 2019 at 17:16, on Zulip):

guess I need to re-read that RFC again

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

maybe ping @Vadim Petrochenkov to ask their opinion on the issue, they ought to know

centril (Oct 08 2019 at 17:16, on Zulip):

yea, we pinged them few times by now collectively :D

centril (Oct 08 2019 at 17:16, on Zulip):

(I thought it was just a partial relaxation...)

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

current on deck issues are only 3:

Vadim Petrochenkov (Oct 08 2019 at 17:17, on Zulip):

The RFC was about removing the private-in-public lint, that's directly opposite to making it an error.

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

exactly, @Vadim Petrochenkov -- we are discussing if the FCW should just be removed entirely, rather than making it an error in the case of async fn

Vadim Petrochenkov (Oct 08 2019 at 17:17, on Zulip):

Right now it's generally an error and sometimes a lint, where "sometimes" == "wasn't reported by an ancient version of the private-in-public checking pass"

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

heh yes

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

so maybe the proper fix is to implement rfc#2145, basically

centril (Oct 08 2019 at 17:18, on Zulip):

anyways, since it doesn't seem like it should be made an error I think we don't do anything special for async fn then

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

@Giles Cope so you mentioned wanting some work to do :)

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

not sure @csmoe if you also are looking for things

Vadim Petrochenkov (Oct 08 2019 at 17:20, on Zulip):

we are discussing if the FCW should just be removed entirely

Ah, ok, we can remove it any moment - functions with leaked private types will be unusable.
The only drawback will be no linting at the definition site, so it will be pretty easy for library authors to produce unusable function.

csmoe (Oct 08 2019 at 17:20, on Zulip):

not sure csmoe if you also are looking for things

yep

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

looking at the on-deck list, I kind of think we should remove "Cannot await in scope that contains call to format! #64960" from the list, mostly because I sort of have no idea how we are going to fix in short term?

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

Seems sensible

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

Maybe https://github.com/rust-lang/rust/issues/62570 is a good issue to prioritize?

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

Ah, I sort of remember -- I thought it might be the case that being more precise about what lives over an await might help with format in particular

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

(given the prevalence of ? + async)

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

that sounds reasonable, I'm not sure if we have a vague idea how to fix?

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

Basically I think we want to replace a function with a closure, an async...

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

@Giles Cope or @csmoe, either of you interested in #62570? It sounded like @Esteban K├╝ber had some thoughts from the issue comments

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

ok, @centril I think it'd be helpful to post with what you would like error message to say

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

will do

Giles Cope (Oct 08 2019 at 17:23, on Zulip):

if it's improved diagnostics that sounds cool with me

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

from a quick read, I wasn't really clear on what the problem/fix was

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

ok, assigning to @Giles Cope

Giles Cope (Oct 08 2019 at 17:24, on Zulip):

in for a penny :-)

centril (Oct 08 2019 at 17:24, on Zulip):

the current message originates from:

#[rustc_on_unimplemented(
   on(all(
       any(from_method="from_error", from_method="from_ok"),
       from_desugaring="QuestionMark"),
      message="the `?` operator can only be used in a \
               function that returns `Result` or `Option` \
               (or another type that implements `{Try}`)",
      label="cannot use the `?` operator in a function that returns `{Self}`"),
   on(all(from_method="into_result", from_desugaring="QuestionMark"),
      message="the `?` operator can only be applied to values \
               that implement `{Try}`",
      label="the `?` operator cannot be applied to type `{Self}`")
)]
nikomatsakis (Oct 08 2019 at 17:25, on Zulip):

I'm marking https://github.com/rust-lang/rust/issues/64960 as assigned to me just to do a bit of digging

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

(the format! thing)

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

I don't think I'll have time to fix

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

and don't plan on it

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

I just want to evaluate what we might do

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

anyway we still need something for @csmoe :)

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

I think we want:

#[rustc_on_unimplemented(
   on(all(
       any(from_method="from_error", from_method="from_ok"),
       from_desugaring="QuestionMark"),
      message="the `?` operator can only be used in {ctx} \
               that returns `Result` or `Option` \
               (or another type that implements `{Try}`)",
      label="cannot use the `?` operator in {ctx} that returns `{Self}`"),
   on(all(from_method="into_result", from_desugaring="QuestionMark"),
      message="the `?` operator can only be applied to values \
               that implement `{Try}`",
      label="the `?` operator cannot be applied to type `{Self}`")
)]

but I have no idea how we can magically make ctx say the right thing

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

Here is a list of other issues that are neither on-deck nor focus

centril (Oct 08 2019 at 17:27, on Zulip):

Oh I know... ctx would just be the item context converted to English

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

I'm skimming over issues here

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

Async-related type error messages defy expectations (in span location) #65180

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

this might be a good one, @csmoe -- I don't really know what the problem is precisely, it'll take a little digging though

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

Unhelpful error message with async usage of Iterator #63385

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

similarly here I see a few like this

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

but it'll also take some digging :)

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

ok let's start with #65180 I guess

csmoe (Oct 08 2019 at 17:31, on Zulip):

this might be a good one, csmoe -- I don't really know what the problem is precisely, it'll take a little digging though

thanks, I claim this :slight_smile:

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

ok great, thanks all!

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

FIN

Last update: Nov 18 2019 at 00:40UTC