Skip to content

Commit 9271e41

Browse files
committed
crashes: add another test showing that everything works fine when we need compile-flags to repro an ice
1 parent a16bc36 commit 9271e41

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

tests/crashes/122909.rs

+13
Original file line numberDiff line numberDiff line change
@@ -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

-1
This file was deleted.

0 commit comments

Comments
 (0)