"By the way, if anyone here is..." <- > <@jamesmunns:beeper.com> By the way, if anyone here is using `static mut` for anything, I'd be interested in hearing about it. IMO, it is *very* easy to accidentally do an undefined behavior with them. > > Instead of writing up all the ways you can accidentally do that, I'm working on a (currently pretty limited) crate to provide some alternatives: https://docs.rs/grounded > > But if you have something you think you need `static mut` for, I'm definitely interested to figure out what building blocks would be useful to have available. I've use them once in a while if I want to prove something to me. For example, I'm inspecting some generated assembly and I need a write to not be optimized away. A static mut is a quick way to get that in place of a let mut. Another thing I can imagine, but haven't done myself so far is having to have a global variable for compat with C. Say a C lib has a global extern variable, how would you create that un Rust without static mut?