3 ms·
Yeah I suppose I would've been inclined to just throw out any deps that are built atop unsafe. It seems to kind of totally ruin the intended purpose of Rust as
by void_mint 5y ago
Yeah I suppose I would've been inclined to just throw out any deps that are built atop unsafe. It seems to kind of totally ruin the intended purpose of Rust as a language (to me, who is uninvolved).
- kibwen 5y agoThat's perfectly valid, and you would likely benefit from the cargo-geiger tool mentioned above (or just plain-old grep for "unsafe").
- bsder 5y ago"unsafe" doesn't always mean unsafe. For example, you wish to implement a Vector in Rust. You generally don't want to allocate that Vector over and over, so you request more memory than you need. That "extra" memory is uninitialized which is a big no-no in Rust. You might be able to initialize that memory, but that will have performance implications that C/C++ programmers would just laugh at. However, your "invariant" is that you never access that memory until you have a real element that you put there. That's perfectly fine. Nevertheless, accessing that uninitialized area will always be "unsafe" from the Rust compiler point of view.
- iudqnolq 5y agoThere has to be some unsafe, or else you can't have the parts of the standard library that interact with the OS. I'd at a minimum also include projects with experienced authors and similar needs such as tokio.