3 ms·
> and perhaps reason to nudge the developers to find ways to get rid of it! Or perhaps nudge users to understand what `unsafe` means and why its necessary rath
by duped 3y ago
> and perhaps reason to nudge the developers to find ways to get rid of it!
Or perhaps nudge users to understand what `unsafe` means and why its necessary rather than evangelize at maintainers.
- dgacmu 3y agoNah. The log crate primarily uses unsafe to poke at pointers in a probably-ok-but-racy way on platforms that don't support atomics. It would almost certainly be better to use a platform-appropriate mutex for those limited contexts, or at least allow the presumably-faster, presumably-benign race to be hidden behind a feature flag. I'm quite familiar with what unsafe means. And in the context of supply chain attacks, there's a clear benefit from going from "a few uses of unsafe as a possible performance optimization" to "no unsafe". Obviously, that doesn't work for all crates and we shouldn't demand it. But I made the comment about log after looking at the code to understand its use of unsafe.