Skip to content
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

Replace assume with assert_unchecked (Rust 1.81) #1345

Open
kkysen opened this issue Sep 9, 2024 · 0 comments
Open

Replace assume with assert_unchecked (Rust 1.81) #1345

kkysen opened this issue Sep 9, 2024 · 0 comments
Labels
good first issue Good for newcomers low priority Issues that we would like to address at some point in the future

Comments

@kkysen
Copy link
Collaborator

kkysen commented Sep 9, 2024

Rust 1.81 stabilized std::hint::assert_unchecked, which is what we want our assume to be. Our assume is a slightly different implementation (that just calls unreachable_unchecked in the false case), and assert_unchecked is implemented more directly with regards to LLVM IR generation. They are largely the same, but assert_unchecked may be optimized slightly better, and Rust is standardizing around this new interface, so we should switch to it.

@kkysen kkysen added good first issue Good for newcomers low priority Issues that we would like to address at some point in the future labels Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers low priority Issues that we would like to address at some point in the future
Projects
None yet
Development

No branches or pull requests

1 participant