const_allocate intrinsic: what should it do at runtime? #93935
Labels
A-allocators
Area: Custom and system allocators
A-const-eval
Area: Constant evaluation, covers all const contexts (static, const fn, ...)
C-discussion
Category: Discussion or questions that doesn't represent real issues.
WG-const-eval
Working group: Const evaluation
We have a const_allocate intrinsic to perform heap allocations during CTFE. It should not be called during runtime, but we do have to generate some code for that case. Currently, we make it return NULL.
I think calling this at runtime is always an error, so we shouldn't just silently continue execution. We should either panic or abort. (The codegen backend already knows how to do both of these things, so this should not be very hard to implement.)
@rust-lang/wg-const-eval what do you think?
The text was updated successfully, but these errors were encountered: