File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1179,12 +1179,16 @@ pub(crate) unsafe extern "C" fn assign_sequence_item_from_mapping(
1179
1179
result
1180
1180
}
1181
1181
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.
1184
1190
pub unsafe trait OffsetCalculator < T : PyClass , U > {
1185
1191
/// 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.
1188
1192
fn offset ( ) -> usize ;
1189
1193
}
1190
1194
You can’t perform that action at this time.
0 commit comments