fn foo<T>() { use std::sync::{Once, ONCE_INIT}; static INIT: Once = ONCE_INIT; INIT.call_once(|| { // run initialization here println!("Called"); }); } fn main() { foo::<i64>(); foo::<i64>(); foo::<isize>(); } 0000000000007510 <_ZN4test4main17h916a53db53ad90a1E>: 7510: 50 push rax 7511: e8 5a ff ff ff call 7470 <_ZN4test3foo17h61cadb66d9062e2eE> 7516: e8 55 ff ff ff call 7470 <_ZN4test3foo17h61cad
{{#tags}}- {{label}}
{{/tags}}