Stream: general

Topic: StorageLive/Dead in consts


RalfJ (Jun 26 2019 at 08:28, on Zulip):

We have a comment in eval_context.rs that says "// statics and constants don't have Storage* statements, no need to look for them". But that doesn't seem true any more, check the MIR of this:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a31c523fb2599970eb92fd4be73e6261

RalfJ (Jun 26 2019 at 08:28, on Zulip):

was that a deliberate change? Cc @oli

oli (Jun 26 2019 at 08:29, on Zulip):

I'm not sure if the comment was ever true

oli (Jun 26 2019 at 08:29, on Zulip):

This comment is from very early miri

oli (Jun 26 2019 at 08:29, on Zulip):

when we still pushed stack frames for constants and statics

RalfJ (Jun 26 2019 at 08:30, on Zulip):

I remember adding that comment. It was true back then. :)

RalfJ (Jun 26 2019 at 08:30, on Zulip):

wait we don't do that any more?

RalfJ (Jun 26 2019 at 08:30, on Zulip):

CTFE has a stack frame for the outermost const/static item (and then the const fn it calls), doesn't it?

oli (Jun 26 2019 at 08:59, on Zulip):

yea, but we used to also push stack frames for referenced statics/constants if they weren't computed yet

RalfJ (Jun 26 2019 at 13:13, on Zulip):

yeah I remember, we used to compute statics/consts with the Miri machine on the same stack as the "main" program

RalfJ (Jun 26 2019 at 13:13, on Zulip):

it was crazy^^

Last update: Nov 20 2019 at 12:00UTC