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

Function test_into_native_fn_noalloc

crates/vm/src/function/builtin.rs:224–232  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

222
223 #[test]
224 fn test_into_native_fn_noalloc() {
225 fn py_func(_b: bool, _vm: &crate::VirtualMachine) -> i32 {
226 1
227 }
228 assert_eq!(size_of_val(&py_func.into_func()), 0);
229 let empty_closure = || "foo".to_owned();
230 assert_eq!(size_of_val(&empty_closure.into_func()), 0);
231 assert_eq!(size_of_val(static_func(empty_closure)), 0);
232 }
233}

Callers

nothing calls this directly

Calls 1

to_ownedMethod · 0.45

Tested by

no test coverage detected