Skip to content

Commit fec85ec

Browse files
committed
clippy
1 parent 7aa721b commit fec85ec

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/impl_/pyclass.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,12 +1179,16 @@ pub(crate) unsafe extern "C" fn assign_sequence_item_from_mapping(
11791179
result
11801180
}
11811181

1182-
// Below MSRV 1.77 we can't use `std::mem::offset_of!`, and the replacement in
1183-
// `memoffset::offset_of` doesn't work in const contexts for types containing `UnsafeCell`.
1182+
/// Helper trait to locate field within a `#[pyclass]` for a `#[pyo3(get)]`.
1183+
///
1184+
/// Below MSRV 1.77 we can't use `std::mem::offset_of!`, and the replacement in
1185+
/// `memoffset::offset_of` doesn't work in const contexts for types containing `UnsafeCell`.
1186+
///
1187+
/// # Safety
1188+
///
1189+
/// The trait is unsafe to implement because producing an incorrect offset will lead to UB.
11841190
pub unsafe trait OffsetCalculator<T: PyClass, U> {
11851191
/// Offset to the field within a `PyClassObject<T>`, in bytes.
1186-
///
1187-
/// The trait is unsafe to implement because producing an incorrect offset will lead to UB.
11881192
fn offset() -> usize;
11891193
}
11901194

0 commit comments

Comments
 (0)