• 0 Posts
  • 3 Comments
Joined 3 years ago
cake
Cake day: June 9th, 2023

help-circle

  • But if you are doing something advanced, down at the hardware level

    This part is wrong. Otherwise yes correct.

    The “unsafe” code in rust is allowed to access memory locations in ways that skip the compiler’s check and guarantee that that memory location has valid data. They programmer is on their own to ensure that.

    Which as you say is just the normal state of affairs for all C code.

    This is needed not because of hardware access but just because sometimes the proof that the access is safe is beyond what the compiler is able to represent.