Re:Comparing k-NN in Rust
by pbsd on Tuesday June 10, 2014 @01:00PM
(#7873761)
Well Rust is checking for null pointers at the assembly level: http://goo.gl/eh2aqc (lines 22--27).
[ Parent
| on HN ]
Blech. I'm pretty sure LLVM, not the frontend, is inserting those null checks for some reason.
The slice iterator yields `Option<&T>`, the None variant is represented by a null pointer. That's probably the null check.
This is https://github.com/mozilla/rust/issues/11751: LLVM doesn't understand (non)null pointers enough.