yoanlcq / vek

Generic 2D-3D math swiss army knife for game engines, with SIMD support and focus on convenience.
https://docs.rs/vek
Apache License 2.0
282 stars 32 forks source link

Casting can no longer produce undefined behavior (UB) #59

Closed martin-t closed 4 years ago

martin-t commented 4 years ago

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?

yoanlcq commented 4 years ago

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.

yoanlcq commented 4 years ago

That should be fine, let me know if you have any thoughts about this.

martin-t commented 4 years ago

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.