We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a16bc36 commit 9271e41Copy full SHA for 9271e41
tests/crashes/122909.rs
@@ -0,0 +1,13 @@
1
+//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes
2
+
3
+use std::sync::{Arc, Context, Weak};
4
5
+pub struct WeakOnce<T>();
6
+impl<T> WeakOnce<T> {
7
+ extern "rust-call" fn try_get(&self) -> Option<Arc<T>> {}
8
9
+ pub fn get(&self) -> Arc<T> {
10
+ self.try_get()
11
+ .unwrap_or_else(|| panic!("Singleton {} not available", std::any::type_name::<T>()))
12
+ }
13
+}
tests/crashes/no-ice.rs
0 commit comments