Weird stuff. Ain't high, ain't drunk, but shit's happening, and it is fucked up. I can smell rainbows.
@@ -0,0 +1,21 @@
+//! This test is a more subtle one. It is one which can hit thread destructors unexpectedly.
+
+extern crate ralloc;
+use std::sync::Arc;
+use std::thread;
+fn main() {
+ let numbers: Vec<_> = (0..100).collect();
+ let shared_numbers = Arc::new(numbers);
+ for _ in 0..10 {
+ let child_numbers = shared_numbers.clone();
+ thread::spawn(move || {
+ let local_numbers = &child_numbers[..];
+ // Work with the local numbers
+ });
+ }
+}