Stream: wg-async-foundations

Topic: https://github.com/rust-lang/rust/issues/65180


csmoe (Oct 16 2019 at 12:43, on Zulip):

@Taylor Cramer
this issue caused by an unexpected "skip" inside InteriorVistor::record:
when it trying to record type Ok(hyper::service::service_fn(|| { ... }, region_scope_tree.yield_in_scope(scope) returns None, then this type skipped the whole recording procedure as the debug just printed generator_interior: attempting to record type ... followed by no type in expr ... immediately(but we actually have TyKind::Infer( printed as _) here

[DEBUG rustc_typeck::check::generator_interior] generator_interior: attempting to record type std::result::Result<_, _> Some(Node(230)) Some(expr(HirId { owner: DefIndex(19), local_id: 228 }: Ok(hyper::service::service_fn(move || )))) src/lib.rs:25:13: 31:16
[DEBUG rustc_typeck::check::generator_interior] no type in expr = Some(expr(HirId { owner: DefIndex(19), local_id: 228 }: Ok(hyper::service::service_fn(move || )))), count = 5, span = Some(src/lib.rs:25:13: 31:16)
[DEBUG rustc_typeck::check::generator_interior] generator_interior: attempting to record type std::result::Result<_, _> Some(Node(230)) Some(expr(HirId { owner: DefIndex(19), local_id: 228 }: Ok(hyper::service::service_fn(move || )))) src/lib.rs:25:13: 31:16
[DEBUG rustc_typeck::check::generator_interior] no type in expr = Some(expr(HirId { owner: DefIndex(19), local_id: 228 }: Ok(hyper::service::service_fn(move || )))), count = 5, span = Some(src/lib.rs:25:13: 31:16)
[DEBUG rustc_typeck::check::generator_interior] generator_interior: attempting to record type _ Some(Node(230)) Some(expr(HirId { owner: DefIndex(19), local_id: 230 }: { Ok(hyper::service::service_fn(move || )) })) src/lib.rs:24:20: 32:10
[DEBUG rustc_typeck::check::generator_interior] no type in expr = Some(expr(HirId { owner: DefIndex(19), local_id: 230 }: { Ok(hyper::service::service_fn(move || )) })), count = 6, span = Some(src/lib.rs:24:20: 32:10)
[DEBUG rustc_typeck::check::generator_interior] generator_interior: attempting to record type _ Some(Node(230)) Some(expr(HirId { owner: DefIndex(19), local_id: 230 }: { Ok(hyper::service::service_fn(move || )) })) src/lib.rs:24:20: 32:10
[DEBUG rustc_typeck::check::generator_interior] no type in expr = Some(expr(HirId { owner: DefIndex(19), local_id: 230 }: { Ok(hyper::service::service_fn(move || )) })), count = 6, span = Some(src/lib.rs:24:20: 32:10)
[DEBUG rustc_typeck::check::generator_interior] types in generator [], span = src/lib.rs:24:20: 32:10
[DEBUG rustc_typeck::check::generator_interior] types in generator after region replacement {}, span = src/lib.rs:24:20: 32:10

NOTE: rustc should error after generator_interior: attempting to record type _ Some(Node(230)) ...
I did some experiments to catch type _ Some(Node(230)) and apply need_type_info_in_generator without yield_data span_note on it, rustc complained for need type info at Ok span as expected.
what should we report here as no yield found? cc @nikomatsakis

nikomatsakis (Oct 16 2019 at 16:27, on Zulip):

@csmoe what do you mean by a "skip"?

nikomatsakis (Oct 16 2019 at 16:27, on Zulip):

and what makes it "unexpected"?

nikomatsakis (Oct 16 2019 at 16:27, on Zulip):

Is it that the type is already recorded?

csmoe (Oct 16 2019 at 19:01, on Zulip):

csmoe what do you mean by a "skip"?

@nikomatsakis I mean rustc should error on type _ at Span(src/lib.rs:25:13 25:15) Ok(service_fn(|| {...})
as you can search in this debug output with remained unresolved_type, we have 2 unresolved type in the snippet:
1. span(23:25 23:30) service(...)
2. span(25:13 25:15) Ok(...)
the first one was already reported, but the 2nd wasn't.

csmoe (Oct 16 2019 at 19:03, on Zulip):

the debug output was generated from my branch https://github.com/csmoe/rust/commit/b73099fc89add82eeb288507f2762e4da2e5d5c8

csmoe (Oct 16 2019 at 19:20, on Zulip):

pasted image
the log is hard to "parse", so rg'd for you

csmoe (Oct 21 2019 at 13:05, on Zulip):

update:
current error
pasted image

Last update: Nov 18 2019 at 00:40UTC