-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-allocatorsArea: Custom and system allocatorsArea: Custom and system allocatorsA-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.WG-const-evalWorking group: Const evaluationWorking group: Const evaluation
Description
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?
Metadata
Metadata
Assignees
Labels
A-allocatorsArea: Custom and system allocatorsArea: Custom and system allocatorsA-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)Area: Constant evaluation, covers all const contexts (static, const fn, ...)C-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.WG-const-evalWorking group: Const evaluationWorking group: Const evaluation