Skip to content

Commit 9d5e117

Browse files
committed
feat: mark traits as unsafe
1 parent f6d7984 commit 9d5e117

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

src/core/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub mod rbtree;
3232
/// ¹ But only to the extent that doesn't put soundness in jeopardy.
3333
///
3434
/// Panicking in user-provided trait methods may be escalated to aborting.
35-
pub trait IntervalRwLockCore {
35+
pub unsafe trait IntervalRwLockCore {
3636
/// The type used to represent interval endpoints.
3737
type Index;
3838

src/core/rbtree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ impl<Index, Priority, InProgress> RbTreeIntervalRwLockCore<Index, Priority, InPr
338338
}
339339
}
340340

341-
impl<Index, Priority, InProgress> IntervalRwLockCore
341+
unsafe impl<Index, Priority, InProgress> IntervalRwLockCore
342342
for RbTreeIntervalRwLockCore<Index, Priority, InProgress>
343343
where
344344
Index: Clone + Ord,

src/raw/local.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ macro_rules! borrow_core {
3434
};
3535
}
3636

37-
impl<Core: IntervalRwLockCore<InProgress = !>> RawIntervalRwLock for LocalRawIntervalRwLock<Core> {
37+
unsafe impl<Core: IntervalRwLockCore<InProgress = !>> RawIntervalRwLock
38+
for LocalRawIntervalRwLock<Core>
39+
{
3840
type Index = Core::Index;
3941

4042
type TryReadLockState = Core::TryReadLockState;
@@ -74,7 +76,7 @@ impl<Core: IntervalRwLockCore<InProgress = !>> RawIntervalRwLock for LocalRawInt
7476
}
7577
}
7678

77-
impl<Core: IntervalRwLockCore<InProgress = !>> RawBlockingIntervalRwLock
79+
unsafe impl<Core: IntervalRwLockCore<InProgress = !>> RawBlockingIntervalRwLock
7880
for LocalRawIntervalRwLock<Core>
7981
{
8082
type ReadLockState = Core::TryReadLockState;

src/raw/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub mod local;
2727

2828
/// A non-blocking interface to a specialized readers-writer lock optimized for
2929
/// interval locks.
30-
pub trait RawIntervalRwLock {
30+
pub unsafe trait RawIntervalRwLock {
3131
/// The type used to represent interval endpoints.
3232
type Index;
3333

@@ -64,7 +64,7 @@ pub trait RawIntervalRwLock {
6464

6565
/// A blocking interface to a specialized readers-writer lock optimized for
6666
/// interval locks.
67-
pub trait RawBlockingIntervalRwLock: RawIntervalRwLock {
67+
pub unsafe trait RawBlockingIntervalRwLock: RawIntervalRwLock {
6868
/// The storage for per-lock data. Dropping it while it has an associated
6969
/// lock will cause a panic.
7070
type ReadLockState: Default;
@@ -104,7 +104,7 @@ pub trait RawBlockingIntervalRwLock: RawIntervalRwLock {
104104
/// for interval locks.
105105
///
106106
/// [`Future`]: core::future::Future
107-
pub trait RawAsyncIntervalRwLock: RawIntervalRwLock {
107+
pub unsafe trait RawAsyncIntervalRwLock: RawIntervalRwLock {
108108
/// The storage for per-lock data. Dropping it while it has an associated
109109
/// (possibly pending) lock will cause a panic.
110110
type ReadLockState: Default;

0 commit comments

Comments
 (0)