• ProgrammingSocks@pawb.social
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    6 months ago

    Rust simply doesn’t allow you to have references to data that goes out of scope (unless previously mentioned hoops are jumped through such as an explicitly declared unsafe block). It’s checked at compile time. You will never be able to compile the program.

    Rust isn’t C. Rust isn’t C++. The memory-safe-ness of it is also not magic, it’s a series of checks in the compiler.

    • DacoTaco@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      6 months ago

      That sounds odd. That also means that a mapper, command, service,… can never return a class object or entity. Most of the programming world is based on oop o.O
      Keep in mind im not talking about the usage of pointers, but reference typed variables.