Skip to content

Commit

Permalink
Implement [Ref]UnwindSafe for SlotMap
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0246 committed Jun 17, 2024
1 parent 2a44e6c commit 3188610
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use core::{
mem::MaybeUninit,
num::NonZeroU32,
ops::Deref,
panic::{RefUnwindSafe, UnwindSafe},
slice,
sync::atomic::{
AtomicU32, AtomicU64,
Expand Down Expand Up @@ -57,6 +58,9 @@ pub struct SlotMap<T, C: Collector<T> = DefaultCollector> {
free_list_queue: [AtomicU64; 2],
}

impl<T, C: Collector<T>> UnwindSafe for SlotMap<T, C> {}
impl<T, C: Collector<T>> RefUnwindSafe for SlotMap<T, C> {}

impl<T> SlotMap<T, DefaultCollector> {
#[must_use]
pub fn new(max_capacity: u32) -> Self {
Expand Down

0 comments on commit 3188610

Please sign in to comment.