4 ms·
Well Rust is checking for null pointers at the assembly level: http://goo.gl/eh2aqc http://goo.gl/eh2aqc (lines 22--27).
by pbsd 12y ago
Well Rust is checking for null pointers at the assembly level: http://goo.gl/eh2aqc http://goo.gl/eh2aqc (lines 22--27).
- pcwalton 12y agoBlech. I'm pretty sure LLVM, not the frontend, is inserting those null checks for some reason.
- kzrdude 12y agoThe slice iterator yields `Option<&T>`, the None variant is represented by a null pointer. That's probably the null check.
- dbaupp 12y agoThis is https://github.com/mozilla/rust/issues/11751 https://github.com/mozilla/rust/issues/11751: LLVM doesn't understand (non)null pointers enough.