-
Notifications
You must be signed in to change notification settings - Fork 32
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
Casting can no longer produce undefined behavior (UB) #59
Comments
Updating the docs is a good idea. One thing to consider is that some users may not be using the latest 1.45.0 of Rust, so what I think I'll do right now is change the docs to say "hey, if you're using a version Rust before 1.45.0, then you may encounter UB as described: [insert current doc about UB here]". Then I guess one day Rust 1.45.0 would be widespread enough that we could completely remove to parts of the doc about UB. I am unsure of when that day will come and how to measure it, but I guess that'll be fine. |
That should be fine, let me know if you have any thoughts about this. |
I noticed the text here originally comes from the num-traits crate and opened a PR there. In the process, i noticed the second case (float to float conversion) probably never was UB and the second example might be removed. Might wanna keep an eye on that PR to keep the docs in sync. |
184: Update AsPrimitive Safety docs for rust 1.45 r=cuviper a=martin-t Fixes #174 The safety section should not be removed entirely since people might be using older compilers (as was pointed out to me in a [related issue](yoanlcq/vek#59) in the vek crate). However, [this](rust-lang/rust#15536 (comment)) and followup comments indicate that the second case (float to float) was never UB in the first place - should the second example be removed? Co-authored-by: Martin Taibr <[email protected]>
It looks like the 2 issues linked here and in some other places have been resolved and the reference has been updated too.
Should i update the docs?
The text was updated successfully, but these errors were encountered: