We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
1usize
0usize
Why use 1usize instead of 0usize there :
#[inline] pub unsafe fn unreachable() -> ! { enum Void {} let x: &Void = mem::transmute(1usize); match *x {} }
If this function should trigger UB?
The text was updated successfully, but these errors were encountered:
Doesn't really matter, to be clear, right?
It creates a null reference and dereferences it, so it's clearly UB regardless of the value of the reference.
Anyhow on trunk this has been replaced by std::hint::unreachable_unchecked.
std::hint::unreachable_unchecked
Sorry, something went wrong.
No branches or pull requests
Why use
1usize
instead of0usize
there :If this function should trigger UB?
The text was updated successfully, but these errors were encountered: