redpen
redpen copied to clipboard
Indexing operations are not accurate on whether they panic
rustc doesn't mark the internal APIs that it uses to determine the appropriate trait used by an indexing operation as public. For now, the dont_panic lint always treats indexing as a potentially panicking operation as a stop-gap.
This does not seem to work with indexing that does not use usize as the index, for example it does not seem to catch the following panic:
fn main() {
let mut map = std::collections::HashMap::new();
map.insert("foo", "bar");
map["baz"];
}