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

Avoid int to ptr transmute by casting first #465

Merged
merged 1 commit into from
May 24, 2022

Conversation

thomcc
Copy link
Member

@thomcc thomcc commented May 24, 2022

According to @RalfJung this is UB (or will soon be UB, or something), and this is the workaround. Which is harmless enough.

@RalfJung
Copy link
Member

Cc rust-lang/rust#97321

@Amanieu
Copy link
Member

Amanieu commented May 24, 2022

I'm happy to merge this for now since, as you said, it is harmless enough but I'm not a big fan of this change.

@Amanieu Amanieu merged commit a9c2eeb into rust-lang:master May 24, 2022
@thomcc
Copy link
Member Author

thomcc commented May 24, 2022

it is harmless enough but I'm not a big fan of this change

For the record, I agree. I think a better fix would be to make that code allowed.

@thomcc thomcc deleted the cast-before-transmute branch May 24, 2022 17:50
@RalfJung
Copy link
Member

See rust-lang/unsafe-code-guidelines#340 for the UCG thread; please raise your voice there :)

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.

3 participants