Values created by const fns aren't rvalue static promoted #60502
Labels
A-const-fn
Area: const fn foo(..) {..}. Pure functions which can be applied at compile time.
A-diagnostics
Area: Messages for errors, warnings, and lints
A-lifetimes
Area: Lifetimes / regions
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
This function compiles due to rvalue static promotion:
This, however, does not:
Explicitly creating a static does work, however:
The text was updated successfully, but these errors were encountered: