Underscores in Rust
Underscores in Rust
Posted Feb 12, 2025 7:09 UTC (Wed) by mb (subscriber, #50428)In reply to: Underscores in Rust by geofft
Parent article: Maintainer opinions on Rust-for-Linux
>there usually isn't a pattern of "get this RAII object and keep it around for its side effect while doing other stuff".
That's true. It's not done like this in the vast majority of cases.
But there are rare exceptions:
https://docs.rs/tokio/1.43.0/tokio/sync/struct.Semaphore....
But misusing this wouldn't (and must not) cause UB.