3 ms·
Rust doesn't accept "but my program is single-threaded!" as an answer. The language doesn't believe you. Every global has to be thread-safe, or marked as `unsaf
by pornel 6y ago
Rust doesn't accept "but my program is single-threaded!" as an answer. The language doesn't believe you. Every global has to be thread-safe, or marked as `unsafe` to use.
- Rusky 6y agoThe "my program is single-threaded" button is thread-local storage. If your program truly is single-threaded, then TLS is the same thing as a global!