glium / glium

Safe OpenGL wrapper for the Rust language.
Apache License 2.0
3.5k stars 406 forks source link

Get rid of mem::uninitialized completely #1767

Open est31 opened 5 years ago

est31 commented 5 years ago

Continuation of #1753. @Lokathor has removed mem::uninitialized usage in the glium crate itself in #1759, but some examples still contain it.

ghost commented 4 years ago

I think that https://github.com/glium/glium/pull/1853 could solve this? I used ripgrep and sed to replace all instances of it.

est31 commented 4 years ago

1853 replaced uninitialized with assume_init, but optimally we'd have functions as described here.

Lokathor commented 4 years ago

Just glancing at the changes in #1853, it's almost certainly wrong and UB, but they're no_run examples so... maybe it doesn't matter.

Then again, examples should probably be correct because someone probably copies them into their project as a starting point.