Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    let foo = [1, 2, 3];
    unsafe {
        *foo.get_unchecked_mut(4) = 5;
    }
Not sure why Rust evangelists always seem to ignore that unsafe exists.


Hmmm... where could the oob access possibly be I can't tell


Easy to spot in a contrived example is not:

> impossible to express in Rust

I’m not going to argue with Rust folks who misrepresent the language.


You can prevent unsafe from being used in a repo with linter rules.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: