-
-
Notifications
You must be signed in to change notification settings - Fork 150
Remove all unsafe, #![forbid(unsafe_code)]
#214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
I love zerocopy and what it's trying to do, and if this stuff were in std, I'd absolutely have no hesitation doing this (assuming we waited long enough to keep the MSRV somewhat conservative). But I think my view is generally unchanged from rust-lang/regex#1189. This isn't bringing in the proc macro, but it still makes I think this stance probably applies to most of my crates. One place where I'd differ is for opt-in support like serde so that types implement the relevant zerocopy traits. I'm not sure if any of my crates fall into that bucket though. (Maybe I think I'd actually probably rather folks decrease dependency on |
No worries, I totally understand! In putting up these PRs, I made sure I hadn't already put up PRs to the same repo in the past that got declined, but I forgot about other repos by the same author - sorry for the noise!
Do you think you'd be more inclined to take the dependency if there were less of a slowdown? Not that this particular PR is super important to me, but it's good to get a sense of what the maintainers of important crates care about. E.g. I could see us putting functionality behind default-enabled feature flags so that users who care can disable everything and speed up compile times. |
|
That's a good question. I honestly don't know. No matter how much it decreases, it's still non-zero. And I do overall feel like the code in byteorder is relatively low-risk and it isn't changing much if at all. It's been nearly frozen for many years. So while the downsides could maybe be mitigated to an extent, the upside isn't huge in this case. I think I'd also be more inclined to do it if a lot more people were using zerocopy. (I don't have a good sense of how often it appears in dependency trees.) But that's a chicken-and-egg problem... |
|
Okay, that's helpful context, thanks! |
8ca1c32 to
bf17ec7
Compare
|
We recently added a feature to zerocopy that allowed me to update this to remove the remaining |
#![forbid(unsafe_code)]
|
That's awesome. I don't think my stance has changed personally. It might make sense to add a note to the README recasting byteorder as a "lightweight dependency for byte order conversions, but if you already are using |
|
No worries! |
No description provided.