Question about safety when accessing an array out of bounds

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • wuffs

    Wrangling Untrusted File Formats Safely

  • There are some tools which make things like these a compile-time errors instead, some are even used in practice, but of course in languages like these you couldn't just take random index and try to access array member, no, you would have to add proof of the correctness to each and every index access for the compiler to check.

  • book

    The Rust Programming Language

  • Is rust's memory safety guaranteed at runtime or compile time? I was under the impression "if it compiles, then it works". Trying to directly access array[11] does throw a compilation error, which caused further confusion as to why it did not cause a compilation error when in a loop. I found this issue from 2020 but no clear resolution. Any/all feedback is appreciated.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts