Hacker News new | ask | show | jobs
by davemp 71 days ago

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

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.