Initializers of stable constants can call const unstable functions #68743
Labels
A-const-eval
Area: Constant evaluation (MIR interpretation)
A-stability
Area: `#[stable]`, `#[unstable]` etc.
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Crates using
staged_api
are forbidden from calling const unstable functions from stable const functions. However, this restriction does not extend to the initializers of consts or statics. Although unlikely, this could allow for "backdoor stabilization" of various const-eval features. For example, the following would lock in the current implementation ofconst_if_match
.If
BAR
were aconst fn
instead of aconst
, that example would be rejected.cc @rust-lang/wg-const-eval
The text was updated successfully, but these errors were encountered: