Hacker News new | ask | show | jobs
by jbboehr 884 days ago
> Rust requires unsafe code to implement any non-trivial data structures

That seems like a gross overstatement.

https://github.com/rust-lang/rust/blob/master/library/std/sr...

CTRL-F: unsafe

Only one result, an optional utility function: "pub unsafe fn get_many_unchecked_mut"

1 comments

That's a wrapper around the actual implementation (which lives in an external package). Notice "use hashbrown::hash_map as base;" at the top.

There's far more unsafe there: https://github.com/rust-lang/hashbrown/blob/f2e62124cd947b5e...