Closed
Description
I investigated the only "tried to modify constant memory" in #55 and it's due to the fact that Miri can't properly initialize statics that recursively refer to each other. This would be low priority since it only affects the unstable #![feature(static_recursion)]
, but the feature looks like it will be stable soon.
E.g.
struct S(&'static S);
static S1: S = S(&S2);
static S2: S = S(&S1);
When you start initializing S1:
- you'll start initializing S2 because it's required (
ConstantExtractor
) - write the final result for S2
- freeze S2 and all allocations it references (this freezes S1)
- pick up where you left off initializing S1
- write the final result for S1 (fails because it's frozen)