Description
Given that the CTFE core engine already supports the entire display machinery (demonstrated by the fact that it works in Miri), we might alternatively poke a small hole into the const checks that allows executing formatting machinery from panic_fmt
only -- something like "miri unleashed", but more targeted.
Originally posted by @RalfJung in #78356 (comment)
Basically the same rationale as allowing -> _ return types in the parser, to get a better error later. In this case, when you use panic!() in CTFE, you are going to fail the build anyway, so we can just as well run something that may fail to get evaluated because it does something horribly unconst.
The only problem is that then const fn can execute non-const code at runtime during the panic machinery and before actually panicking, which may not be desirable.