rust/tests/ui/consts/write-to-static-mut-in-static.stderr
Oli Scherer 73b38c661d Do not allocate a second "background" alloc id for the main allocation of a static.
Instead we re-use the static's alloc id within the interpreter for its initializer to refer to the `Allocation` that only exists within the interpreter.
2024-02-15 10:25:18 +00:00

16 lines
601 B
Plaintext

error[E0080]: could not evaluate static initializer
--> $DIR/write-to-static-mut-in-static.rs:2:33
|
LL | pub static mut B: () = unsafe { A = 1; };
| ^^^^^ modifying a static's initial value from another static's initializer
error[E0080]: could not evaluate static initializer
--> $DIR/write-to-static-mut-in-static.rs:7:21
|
LL | pub static D: u32 = D;
| ^ encountered static that tried to initialize itself with itself
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.