2014-01-18 13:21:10 -06:00
|
|
|
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
// compile-flags: -Z no-landing-pads
|
2016-02-11 05:34:41 -06:00
|
|
|
// ignore-emscripten no threads support
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2015-02-17 17:24:34 -06:00
|
|
|
use std::thread;
|
2014-01-18 13:21:10 -06:00
|
|
|
|
|
|
|
static mut HIT: bool = false;
|
|
|
|
|
|
|
|
struct A;
|
|
|
|
|
|
|
|
impl Drop for A {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
unsafe { HIT = true; }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2015-02-17 17:24:34 -06:00
|
|
|
thread::spawn(move|| -> () {
|
2014-01-18 13:21:10 -06:00
|
|
|
let _a = A;
|
2014-10-09 14:17:22 -05:00
|
|
|
panic!();
|
2015-01-20 17:45:07 -06:00
|
|
|
}).join().err().unwrap();
|
2014-01-18 13:21:10 -06:00
|
|
|
assert!(unsafe { !HIT });
|
|
|
|
}
|