Skip to content

Commit 14bf9c5

Browse files
committed
Add comment regarding load-bearing drop order
1 parent de40bb1 commit 14bf9c5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/test.rs

+3
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ impl<const N: usize> Drop for Dropper<N> {
5353

5454
pub struct OwnedHeap<const N: usize> {
5555
heap: Heap,
56+
// /!\ SAFETY /!\: Load bearing drop order! `_drop` MUST be dropped AFTER
57+
// `heap` is dropped. This is enforced by rust's built-in drop ordering, as
58+
// long as `_drop` is declared after `heap`.
5659
_drop: Dropper<N>,
5760
}
5861

0 commit comments

Comments
 (0)