• ProgrammingSocks@pawb.social
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    4 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.