Skip to content

Fix unsound float cast - #20

Open
nicoburns wants to merge 2 commits into
dfrg:mainfrom
DioxusLabs:devin/1786050881-fix-unsound-float-cast
Open

nicoburns wants to merge 2 commits into
dfrg:mainfrom
DioxusLabs:devin/1786050881-fix-unsound-float-cast

Conversation

@nicoburns

@nicoburns nicoburns commented Aug 12, 2026 •

Copy link
Copy Markdown

Was auditing zeno for unsafe code. There is one instance:

unsafe { (v * 256.).to_int_unchecked() }

My LLM reckons that both:

  • This usage is unsound (it is not validated and can be out of range, NaN, etc). See test case, which it has run under MIRI.
  • Makes no difference to performance (it has run it's own benchmarks - not sure how representative they are)

This PR also:

  • Removes some #[allow(clippy::uninit_assumed_init, invalid_value)] which are no longer needed (already the case on main - code that needed them was already removed).
  • Adds #![forbid(unsafe_code)] (seeing as the crates now has no unsafe code)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant