Re:Let rand = main as usize
by umanwizard on Thursday June 06, 2024 @07:35PM
(#40603684)
It’s technically true that you can make unsafe mean whatever you want in your own projects, but redefining it to include nondeterministim that doesn’t itself result in UB would be such a fundamental change to the semantics broadly accepted by the rust community that it’s very unlikely they would do so for language constructs like `as`.
That said, I think `as` is generally a code smell and the one large professional Rust project I’ve worked on banned it in CI via clippy.
That said, I think `as` is generally a code smell and the one large professional Rust project I’ve worked on banned it in CI via clippy.