os-rust/tests/ui/thread-local/thread-local-static.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
744 B
Text
Raw Normal View History

2023-12-07 11:56:48 +00:00
error[E0133]: use of mutable static is unsafe and requires unsafe function or block
2024-08-17 14:19:34 +02:00
--> $DIR/thread-local-static.rs:10:28
2023-12-07 11:56:48 +00:00
|
LL | std::mem::swap(x, &mut STATIC_VAR_2)
| ^^^^^^^^^^^^ use of mutable static
|
= note: mutable statics can be mutated by multiple threads: aliasing violations or data races will cause undefined behavior
error[E0625]: thread-local statics cannot be accessed at compile-time
2024-08-17 14:19:34 +02:00
--> $DIR/thread-local-static.rs:10:28
|
LL | std::mem::swap(x, &mut STATIC_VAR_2)
| ^^^^^^^^^^^^
2024-08-17 14:19:34 +02:00
error: aborting due to 2 previous errors
2024-08-17 14:19:34 +02:00
Some errors have detailed explanations: E0133, E0625.
For more information about an error, try `rustc --explain E0133`.