| 1412 | #[deprecated(note = "use downcast_unchecked_ref instead")] |
| 1413 | #[inline(always)] |
| 1414 | pub const unsafe fn payload_unchecked<T: PyPayload>(&self) -> &T { |
| 1415 | // we cast to a PyInner<T> first because we don't know T's exact offset because of |
| 1416 | // varying alignment, but once we get a PyInner<T> the compiler can get it for us |
| 1417 | let inner = unsafe { &*(&self.0 as *const PyInner<Erased> as *const PyInner<T>) }; |
| 1418 | &inner.payload |
| 1419 | } |
| 1420 | |
| 1421 | #[deprecated(note = "use downcast_ref instead")] |
| 1422 | #[inline(always)] |