MCPcopy Index your code
hub / github.com/RustPython/RustPython / from

Method from

crates/vm/src/object/ext.rs:290–300  ·  view source on GitHub ↗
(pyref: PyRef<T>)

Source from the content-addressed store, hash-verified

288
289impl<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
303impl<T: PyPayload> Deref for PyAtomicRef<T> {

Callers

nothing calls this directly

Calls 6

leakFunction · 0.85
newFunction · 0.85
mapMethod · 0.45
into_rawMethod · 0.45
as_ptrMethod · 0.45
castMethod · 0.45

Tested by

no test coverage detected