Stream: t-compiler/help

Topic: Help with `process_projection`


ecstatic-morse (May 25 2020 at 19:16, on Zulip):

@Santiago Pastorino Could you explain what process_projection is doing in the MIR visitor? And what's up with these two lines?

https://github.com/rust-lang/rust/blob/a0f06d11ae7fe29c8e263e2a5d8cd41b372f0283/src/librustc_middle/mir/visit.rs#L905-L906

ecstatic-morse (May 25 2020 at 19:25, on Zulip):

Is this working around the borrow-checker somehow?

ecstatic-morse (May 25 2020 at 19:29, on Zulip):

And why does visit_projection exist only for Visitor, not for MutVisitor? Why do we need this in addition to visit_place/visit_projection_elem?

ecstatic-morse (May 25 2020 at 20:04, on Zulip):

Ah, I see. There's places where we want to skip a projection but continue iterating.

Santiago Pastorino (May 25 2020 at 20:49, on Zulip):

@ecstatic-morse we should make this solution a bit better

Santiago Pastorino (May 25 2020 at 20:49, on Zulip):

but did you figure it out?

ecstatic-morse (May 25 2020 at 20:52, on Zulip):

I'm working to remove PlaceContext::Projection, which isn't used in mutable visitors so I've punted on that part of it for now.

Last update: Sep 27 2020 at 14:30UTC