logoalt Hacker News

wasmpersonyesterday at 9:54 PM1 replyview on HN

Yes, rust didn't invent the concept of an iterator, and is thus not the only language which offers a solution to statically avoid bounds checks. Feel free to give a more "interesting" case you believe rust wouldn't be able to handle.


Replies

ueckeryesterday at 10:19 PM

Rust fails to prove basic indirection to be statically safe and instead does a run-time check.

  fn main() {
    let v = vec![1, 2, 3];
    v[5];
  }
show 2 replies