12 comments

[ 2.4 ms ] story [ 38.9 ms ] thread
Disgusting. I love it.
I usually just box it and then Box::into_raw when I need multiple mutable references in a singlethreaded application where there's no deallocation or cleanup has to occur post shutdown.
This reminds me of Perl's ACME modules and I'm here for that.
I would go for a Rust version of Acme::Bleach.
(comment deleted)
Macros can secretly add "unsafe" blocks into the code?
though said for education purpose, keep finding these boundary-pushings playful. I can recall early days arrested by "several ways to access private members in C++" lol
Cool idea. I was expecting more than just turn_off_the_borrow_checker in you_can though.

Maybe with time, as more counterexamples are needed for things "you can't just..." in rust.

Even more unsafe rust, great!
I wonder if this has any measurable impact on compile times.
Rust's memory safety is as much a social convention as it is a language feature. The language has something better described as "mutation safety," and it's the job of library developers to use that to design UB-free APIs.

I think many people understand this subconsciously, and that this is what drives some of the more performative security culture in Rust spaces (superfluous safety comments, shunning of certain crate authors, `forbid(unsafe)`, push-back against syntax sugar, etc.).