Skip to content

Commit d9a3467

Browse files
authored
avoid some double negatives
1 parent 709d756 commit d9a3467

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libs/maintaining-std.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ Any value behind a `&mut` reference can be replaced with a new one using `mem::r
173173

174174
Rust doesn't guarantee destructors will run when a value is leaked (which can be done with `mem::forget`), so code should avoid relying on them for maintaining safety. Remember, [everyone poops][Everyone Poops].
175175

176-
It's ok not to run a destructor when a value is leaked because its storage isn't deallocated or repurposed. It's generally _not_ ok not to run a destructor before deallocating or repurposing already initialized storage because [memory may be pinned][Drop guarantee]. Having said that, there can be exceptions for skipping destructors if you can guarantee there's never pinning involved.
176+
It's ok not to run a destructor when a value is leaked because its storage isn't deallocated or repurposed. If the storage is initialized and is being deallocating or repurposing then destructors need to be run first, because [memory may be pinned][Drop guarantee]. Having said that, there can still be exceptions for skipping destructors when deallocating if you can guarantee there's never pinning involved.
177177

178178
### How is performance impacted?
179179

0 commit comments

Comments
 (0)