Stream: wg-async-foundations

Topic: `for<'r> 'r : 'static` is not satisfied #53548


nikomatsakis (Mar 08 2019 at 22:32, on Zulip):

Spent some time investigating this. First off, with debug-assertions enabled, it ICEs on nightly. Secondly, for some strange reason RUST_LOG isn't printing all the debug! from certain modules for me, which is super annoying, but I've been changing them to eprintln! as needed.

nikomatsakis (Mar 08 2019 at 22:32, on Zulip):

In any case, I didn't really figure out what is going on here. =) I'll try to dig more later though, felt like I was starting to see it.

nikomatsakis (Mar 11 2019 at 20:59, on Zulip):

I've been doing more investigation here. The immediate pathway that leads to the error is that we are proving the "well-formed" conditions for a generator witness for<'r> {Store<std::boxed::Box<(dyn Trait + 'r)>>, ()}

nikomatsakis (Mar 11 2019 at 21:00, on Zulip):

This WF code is kind of strange. The way it works is to ignore binders like for and descend, but only to surface constraints that don't involve bound regions.

nikomatsakis (Mar 11 2019 at 21:01, on Zulip):

Here, we correctly find that trait Trait: 'static, which implies that 'r: 'static must hold

nikomatsakis (Mar 11 2019 at 21:02, on Zulip):

However, we wind up ICEing (or, if debug-assertions are disabled, getting the error) because the 'r is "universally quantified"

nikomatsakis (Mar 11 2019 at 21:02, on Zulip):

There are some things that confuse me:

nikomatsakis (Mar 11 2019 at 21:02, on Zulip):
nikomatsakis (Mar 11 2019 at 21:02, on Zulip):
nikomatsakis (Mar 11 2019 at 21:03, on Zulip):

For now I'm going to see if I can reproduce this

nikomatsakis (Mar 11 2019 at 21:04, on Zulip):

Ah, hmm, maybe the generators wind up erasing all regions within or something, and that is why.

nikomatsakis (Mar 11 2019 at 21:05, on Zulip):

Yes, that is what happens

nikomatsakis (Mar 11 2019 at 21:13, on Zulip):

Welp, that suggests a pretty easy fix. I guess it's no more broke than generators today. =)

nikomatsakis (Mar 11 2019 at 21:14, on Zulip):

(Not implying generators are broke; just that if this fix is wrong, I think it would indicate deeper problems)

nikomatsakis (Mar 11 2019 at 21:14, on Zulip):

anyway the real problem is how the WF code works but never mind

nikomatsakis (Mar 11 2019 at 21:17, on Zulip):

yep, found one

Matthew Jasper (Mar 11 2019 at 21:18, on Zulip):
  • Presumably we can get a similar ICE involving a fn type

yep, found one

Instead of a generator, or instead of a trait object?

nikomatsakis (Mar 11 2019 at 21:23, on Zulip):

left a write-up here, including the ICE example

nikomatsakis (Mar 11 2019 at 21:25, on Zulip):

gotta go home now though

nikomatsakis (Mar 11 2019 at 21:26, on Zulip):

all I can say is I can't way to remove this WF code in favor of something universe-based at some point

Last update: Nov 18 2019 at 01:50UTC