main()1fn main() { 2 let cell = once_cell::sync::OnceCell::<u32>::new(); 3 cell.get_or_init(|| { 4 cell.get_or_init(|| 1); 5 2 6 }); 7 } 8 9 /// Dummy test to make it seem hang when compiled as `--test` 10 /// See https://github.com/matklad/once_cell/issues/79 11 #[test] dummy_test()12fn dummy_test() { 13 std::thread::sleep(std::time::Duration::from_secs(4)); 14 } 15