• arendjr@programming.devOP
    link
    fedilink
    arrow-up
    0
    ·
    5 days ago

    Using smart pointers doesn’t eliminate the memory safety issue, it merely addresses one aspect of it. Even with smart pointers, nothing is preventing you from passing references and using it them after they’re freed.

      • robinm@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        17 hours ago

        Is it possible to do in Rust?

        Yes

        Is possible to do in Rust, by mistake, and not easily caught by a review?

        Definitively not.

      • GetOffMyLan@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        4 days ago

        I’m fairly sure use after free isn’t possible unless you explicitly use unsafe code right?

        It’s compiler enforced is the point.