(pyref: PyRef<T>)
| 288 | |
| 289 | impl<T: PyPayload> From<PyRef<T>> for PyAtomicRef<T> { |
| 290 | fn from(pyref: PyRef<T>) -> Self { |
| 291 | let py = PyRef::leak(pyref); |
| 292 | let ptr = py as *const _ as *mut u8; |
| 293 | // Expose provenance so we can re-derive via with_exposed_provenance |
| 294 | // without Stacked Borrows tag restrictions during bootstrap |
| 295 | ptr.expose_provenance(); |
| 296 | Self { |
| 297 | inner: Radium::new(ptr), |
| 298 | _phantom: Default::default(), |
| 299 | } |
| 300 | } |
| 301 | } |
| 302 | |
| 303 | impl<T: PyPayload> Deref for PyAtomicRef<T> { |