Stream: t-compiler/help

Topic: late-bound regions error


nikomatsakis (Jun 04 2019 at 15:35, on Zulip):

Hi @yodal =)

yodal (Jun 04 2019 at 15:36, on Zulip):

Howdy

nikomatsakis (Jun 04 2019 at 15:36, on Zulip):

So indeed relating bound regions is a sign that you are doing something wrong

nikomatsakis (Jun 04 2019 at 15:37, on Zulip):

but I'm not sure where the problem is :)

nikomatsakis (Jun 04 2019 at 15:37, on Zulip):

I guess the first question is where the bound regions are coming from

nikomatsakis (Jun 04 2019 at 15:38, on Zulip):

looking over your branch they are clearly not introduced in the commits there

nikomatsakis (Jun 04 2019 at 15:38, on Zulip):

I'm not 100% sure on what's going on with the const generics setup atm

nikomatsakis (Jun 04 2019 at 15:38, on Zulip):

it's been on my to-do list to try and sync up and in particular work out the canonicalization plan etc but...

nikomatsakis (Jun 04 2019 at 15:39, on Zulip):

do you have some debug printouts or something related to this error? i.e., showing a bit of context? what types are being related?

yodal (Jun 04 2019 at 16:23, on Zulip):

https://pastebin.com/dfY3NT16

yodal (Jun 04 2019 at 16:23, on Zulip):

That is a log of the more pertinent debug messages.

yodal (Jun 04 2019 at 16:24, on Zulip):

The types being related are a const generic that is supposed to be a &'static str and a string literal passed as a const param

yodal (Jun 04 2019 at 16:25, on Zulip):

the string literal in the const param position is the one with the bound region as far as I can tell

yodal (Jun 04 2019 at 16:29, on Zulip):

My gut tells me that check_user_type_annotations, and by connection the AscribeUserType query, is not made to expect bound regions as before const generics the only regions that would be in user annotations would be early bounds, but I could easily be wrong about this

Matthew Jasper (Jun 04 2019 at 16:46, on Zulip):

What do they looks like with -Zverbose?

yodal (Jun 04 2019 at 16:53, on Zulip):

https://pastebin.com/ypC3txgE

nikomatsakis (Jun 04 2019 at 18:17, on Zulip):

My gut tells me that check_user_type_annotations, and by connection the AscribeUserType query, is not made to expect bound regions as before const generics the only regions that would be in user annotations would be early bounds, but I could easily be wrong about this

I think that is correct @yodal -- but I think in general there shouldn't be any bound regions there, at least not without a Binder somewhere

yodal (Jun 05 2019 at 08:56, on Zulip):

After looking into it further, that region is not made within a Binder. It is made as part of the canonicalization leading into the AscribeUserType type_op/query. The relation that fails is then made within that type_op/query. The ReLateBound is created to replace a ReVar and is made at the base innermost binder index.

yodal (Jun 05 2019 at 09:00, on Zulip):

It's late and so I can't dig any further right now. I might dig at this more tomorrow.

nikomatsakis (Jun 05 2019 at 14:16, on Zulip):

@yodal I see -- yes, we do create binders there, but they should be instantiated -- it seems like the bug might be that this instantiation is not occurring

nikomatsakis (Jun 05 2019 at 14:16, on Zulip):

I can help point you at the plces to add debug logs

yodal (Jun 05 2019 at 14:51, on Zulip):

alright, that would be very helpful

Last update: Nov 11 2019 at 22:45UTC