//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes //@ known-bug: #122909 use std::sync::{Arc, Context, Weak}; pub struct WeakOnce(); impl WeakOnce { extern "rust-call" fn try_get(&self) -> Option> {} pub fn get(&self) -> Arc { self.try_get() .unwrap_or_else(|| panic!("Singleton {} not available", std::any::type_name::())) } }