• WalrusByteEnglish
    arrow-up
    23
    arrow-down
    0
    ·
    8 months ago
    link
    fedilink

    Giving off a lot of mixed signals with this one, lol 😅

    • SorteKanin
      arrow-up
      47
      arrow-down
      0
      ·
      8 months ago
      edit-2
      8 months ago
      link
      fedilink

      It’s utilizing an obscure bug in the Rust compiler that unfortunately lets you circumvent the safety guarantees in order to produce undefined behavior - it’s mostly just a joke though, you will not run into the bug in normal code

      • porgamrer
        arrow-up
        4
        arrow-down
        0
        ·
        8 months ago
        link
        fedilink

        Thanks for clarifying. Do you know what the bug is? I gathering it’s something to do with enums and boxing to enable a “safe” transmute, but couldn’t make sense of the code.

        Scary compiler edge cases with value-type enums aren’t surprising though. Trying to implement that feature with memory safety and high performance sounds like a nightmare.

    • TWeaKEnglish
      arrow-up
      11
      arrow-down
      1
      ·
      8 months ago
      link
      fedilink

      My thoughts exactly!

      Now, with cve-rs, you can corrupt your program’s memory without corrupting your program’s memory.