Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::thread;
- struct D(u32);
- impl Drop for D {
- fn drop(&mut self) {
- println!("Dropping {}", self.0);
- }
- }
- fn main() {
- fn die() -> D { panic!("Oh no"); }
- let g = thread::spawn(|| {
- let _a: Vec<_> = vec![D(101), D(102), D(103)];
- let _d: Vec<_> = vec![D(401), D(402), die(), D(404)];
- });
- assert!(g.join().is_err());
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement