Stream: t-compiler/const-eval

Topic: #55549 miri value visitor


RalfJ (Nov 02 2018 at 08:01, on Zulip):

@Oli I applied you walk_array/visit_array suggestion. I suppose I could do something similar for structs. Not sure yet whether I can reach the API you suggested.

oli (Nov 02 2018 at 08:14, on Zulip):

I think you forgot to push

RalfJ (Nov 02 2018 at 08:19, on Zulip):

not "forgot", still doing the 2nd half ;)

oli (Nov 02 2018 at 08:19, on Zulip):

:D

oli (Nov 02 2018 at 08:19, on Zulip):

kk

oli (Nov 02 2018 at 08:20, on Zulip):

do tell me once my suggestions are getting out of hand! You have a clearer picture of what it's needed for

RalfJ (Nov 02 2018 at 08:30, on Zulip):

I have no idea what I am doing^^

RalfJ (Nov 02 2018 at 08:30, on Zulip):

I originally thought I couldn't write a "normal" visitor

RalfJ (Nov 02 2018 at 08:30, on Zulip):

but that was before I had two traits (Value and ValueVisitor)

RalfJ (Nov 02 2018 at 08:31, on Zulip):

now that I do, it's getting better. But I still don't think I can do your visit_array(impl Iterator). that's no loss though.

RalfJ (Nov 02 2018 at 08:31, on Zulip):

or maybe I can, but that will be one step further down the refactoring of this^^

RalfJ (Nov 02 2018 at 08:33, on Zulip):

it's at least compiling again now :)

RalfJ (Nov 02 2018 at 08:36, on Zulip):

@Oli pushed something

RalfJ (Nov 02 2018 at 08:36, on Zulip):

now to see if we can smuggle an iterator into there

RalfJ (Nov 02 2018 at 08:37, on Zulip):

no reason to make that specific to arrays though, I think. visit_aggregate(impl Iterator) has a nice ring to it :D

RalfJ (Nov 02 2018 at 09:21, on Zulip):

woah I have no idea why the borrow checker accepts this^^

RalfJ (Nov 02 2018 at 09:22, on Zulip):

the iterator captures some data, but seemingly little enough that the lifetimes still work out. crazy.

RalfJ (Nov 02 2018 at 09:28, on Zulip):

hm. but for general aggregates I do not think I can make this work... the iterator may need to access memory to determine size&align of a DST

RalfJ (Nov 02 2018 at 12:28, on Zulip):

@Oli I added a commit to this PR that is needed to make the visitor usable in miri where I need it... let me know if you want me to put that in a separate PR instead

oli (Nov 02 2018 at 12:29, on Zulip):

Nah, it's fine to include it here

RalfJ (Nov 02 2018 at 12:44, on Zulip):

dang I need a read-only visitor as well...

RalfJ (Nov 02 2018 at 12:45, on Zulip):

or I need to make everything that might execute a Deref projection take &mut

oli (Nov 02 2018 at 12:45, on Zulip):

isn't purely read-only hard because of force_allocation?

RalfJ (Nov 02 2018 at 12:46, on Zulip):

no it's also because I later want to write another visitor that actually changes stuff

oli (Nov 02 2018 at 12:46, on Zulip):

anyway, you can do that by using a macro like in intravisit

RalfJ (Nov 02 2018 at 12:46, on Zulip):

walks over a value and changes all the tag of pointers in there

RalfJ (Nov 02 2018 at 12:46, on Zulip):

force_allocation is not even called any more

RalfJ (Nov 02 2018 at 12:46, on Zulip):

the other annoying one is place_field

RalfJ (Nov 02 2018 at 12:47, on Zulip):

which needs &mut because... okay I guess that's because force_allocation. the alternative would be for Place::Local to also have an offset or something similarly horrible

oli (Nov 02 2018 at 12:48, on Zulip):

we used to have this... for a short time

oli (Nov 02 2018 at 12:48, on Zulip):

let's not repeat that

RalfJ (Nov 02 2018 at 12:48, on Zulip):

^^

RalfJ (Nov 02 2018 at 12:48, on Zulip):

maybe you can only visit OpTy and MPlaceTy then. I dont want to also make THAT mut-polymorphic

RalfJ (Nov 02 2018 at 12:49, on Zulip):

just force_allocate if you want to visit a PlaceTy

RalfJ (Nov 02 2018 at 12:49, on Zulip):

(which retagging will do)

oli (Nov 02 2018 at 12:50, on Zulip):

makes sense

RalfJ (Nov 02 2018 at 13:10, on Zulip):

okay pushed a mut-polymorphic version. it's not as bad as I thought -- though it would be nicer if we could do it without macros

RalfJ (Nov 02 2018 at 13:25, on Zulip):

I am getting a lifetime error that I dont understand at all... suddenly now that I use 'tcxin argument position in the stacked borrow extension trait, it complains. but other extension traits do that, too...

RalfJ (Nov 02 2018 at 13:26, on Zulip):

oh got it

RalfJ (Nov 02 2018 at 13:26, on Zulip):

some of the other types had hidden lifetimes

RalfJ (Nov 02 2018 at 13:29, on Zulip):

when are we getting mandatory '_ again?^^

oli (Nov 02 2018 at 13:49, on Zulip):

When I'm done cleaning up the compiler :P

RalfJ (Nov 02 2018 at 14:24, on Zulip):

okay, so never then :P

Last update: Nov 15 2019 at 20:50UTC