Closed
Description
Things that need to be moved to the machine before the merger
-
array length computation viaRvalue::Len
- heap allocations via
Rvalue::NullaryOp(NullOp::Box, _)
-
memory::Kind
hasRust
(heap),C
(malloc heap) andEnv
(env var emulation) allocations- We could add a generic
Machine
variant toKind
, which everyMachine
can override
- We could add a generic
-
branching (TerminatorKind::SwitchInt
) isn't allowed in CTFE in Rust right now
Things I'm not sure about
There's a lot of stuff that moving to The Machine will make the code much more complex, even though many of these things are basically trivial additions to const eval that imo Rust should have, but couldn't have had with HIR-based const eval.
-
Function pointers and calling themonlyconst fn
is already a guarantee -
Some casts which aren't supported by CTFE in Rust right now -
Unsizing -
Local variables -
Destructuring -
Rvalue::Discriminant
-
unions
-
enum
creation -
References and dereferencing -
closures and calling them - unsafe code handcrafting a vtable by moving a pointer to a
const fn
into the appropriate vtable fields and then calling the method via a fat pointer pointing to the field.
Some of these things are really hard to untangle from miri without making the code quite riddiculous.
Please check boxes on the things that need to be done in the "I'm not sure"-list and discuss the rest below.
Metadata
Metadata
Assignees
Labels
No labels