rust/tests/ui/statics/read_before_init.stderr

32 lines
1.2 KiB
Plaintext

error[E0080]: encountered static that tried to access itself during initialization
--> $DIR/read_before_init.rs:11:45
|
LL | pub static X: (i32, MaybeUninit<i32>) = (1, foo(&X.0, 1));
| ^^^^^^^^^^^^ evaluation of `X` failed inside this call
|
note: inside `foo`
--> $DIR/read_before_init.rs:19:9
|
LL | std::ptr::copy(x, temp.as_mut_ptr(), num);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `std::ptr::copy::<i32>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
error[E0080]: encountered static that tried to access itself during initialization
--> $DIR/read_before_init.rs:13:45
|
LL | pub static Y: (i32, MaybeUninit<i32>) = (1, foo(&Y.0, 0));
| ^^^^^^^^^^^^ evaluation of `Y` failed inside this call
|
note: inside `foo`
--> $DIR/read_before_init.rs:19:9
|
LL | std::ptr::copy(x, temp.as_mut_ptr(), num);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: inside `std::ptr::copy::<i32>`
--> $SRC_DIR/core/src/ptr/mod.rs:LL:COL
error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0080`.