If we allow that, yes. I donât think we would want to, though, and the line of reasoning in your post doesnât automatically lead to it either. As with UB-freedom, correctly using the opt-out requires knowing the proof obligation for why opting out is OK in this particular case (either to prove locally or to push on your own callers). So if we wanted to allow users to assert a non-const fn can be used in a constant context, they would need a way to know why their particular usage wonât trigger CTFE errors.
For API stability, these obligations would have to be described by the author of the non-const fn, not by the programmer who wants to call them. When documenting that, the author can just as well add a compiler-understood marker for âthere are some obligations that have to be fulfilled for this function to not trigger CTFE errorsâ. Therefore, API-boundary-respecting code doesnât really lose any flexibility by requiring this extra annotation on the non-const functions that it wants to call in a const context.