bytemuck icon indicating copy to clipboard operation
bytemuck copied to clipboard

unsafe_unsound_unstable_remove_static_asserts_for_coverage

Open MaulingMonkey opened this issue 2 years ago • 3 comments

More stable-friendly replacement for https://github.com/Lokathor/bytemuck/pull/88

Since this is a --cfg and not a feature, and it has a scary name, it should be quite difficult and unnecessary for libraries to accidentally relax soundness checks. It'd also be reasonable to ignore this PR and let people temporarilly patch their bytemuck downstream instead per https://github.com/MaulingMonkey/thindx/commit/b6dd1844917a511797280bafb5d8c5406e6ab532 :

# Cargo.toml
[patch.crates-io]
bytemuck.git            = "https://github.com/MaulingMonkey/bytemuck"
bytemuck_derive.git     = "https://github.com/MaulingMonkey/bytemuck"
bytemuck.branch         = "pr-unsafe-unsound-unstable-remove-static-asserts-for-coverage"
bytemuck_derive.branch  = "pr-unsafe-unsound-unstable-remove-static-asserts-for-coverage"

MaulingMonkey avatar Jan 20 '22 04:01 MaulingMonkey

So this lets someone turn off some of the derive checks if they use the odd cfg expression?

If so, that sounds fine I guess. However, it looks like there's some small Cargo.toml conflicts that need a fixup.

Lokathor avatar Mar 29 '22 23:03 Lokathor

I think the point is for codecov bots to not mark the anonymous functions used for the static assertions as uncovered, I guess. But in addition to what Lok said, there's a couple more static asserts now that you'd want to add the #[cfg] to I believe :)

fu5ha avatar Mar 30 '22 05:03 fu5ha

@MaulingMonkey looks like there's some conflicts that need fixing still

Lokathor avatar Mar 21 '23 15:03 Lokathor