top | item 46273036

(no title)

emilbratt | 2 months ago

Yeah, even the official Rust book points it out and if my memory serves me right (not punintended) also gives an example in the form of creating a memory leak (not to be confused with memory unsafe).

discuss

order

spookie|2 months ago

A memory leak can be unsafe though.

201984|2 months ago

Then why is Box::leak not marked unsafe?

estebank|2 months ago

"unsafe" or `unsafe`? One is the general meaning of the word, the latter is "it invokes undefined-behavior".