Stream: t-compiler/const-eval

Topic: Terminology for statically checking `const` bodies


ecstatic-morse (Oct 18 2019 at 15:48, on Zulip):

I've proposed some standard terminology for promotion in rust-rfcs/const-eval#28. I've also been calling the code I wrote that checks the body of a const for illegal operations "validation". However, I learned yesterday that MIRI refers to its dynamic checks for const-safety and UB as "validation" as well.

I'd like to call the static validation "const checking" everywhere and continue to refer to the dynamic part as validation. It would be clearer to call one "static validation" and the other "dynamic validation", but people inevitably drop the prefix.

RalfJ (Oct 19 2019 at 09:08, on Zulip):

MIRI refers to its dynamic checks for const-safety and UB as "validation" as well.

not just const-safety -- this is checking "validity" in the sense I defined here

RalfJ (Oct 19 2019 at 09:08, on Zulip):

we use this both for const-safety of the final value of a const, but also in stand-alone Miri to check every value we ever see and make sure it satisfies its validity invariant

RalfJ (Oct 19 2019 at 09:10, on Zulip):

I'd like to call the static validation "const checking" everywhere

SGTM.

and continue to refer to the dynamic part as validation.

validtion in Miri is specifically about the validity invariant and related notions -- it's "checking a thing on values".
the dynamic part of const checking is more than that, e.g. we have a dynamic check to make sure we only execute const functions during CTFE (and with -Zunleash-miri that check could actually kick in... do we have a test for that?)

RalfJ (Oct 19 2019 at 09:10, on Zulip):

looks like we don't... adding one^^

Last update: Nov 15 2019 at 20:25UTC