]> git.lizzy.rs Git - rust.git/blob - src/test/ui/test-thread-capture.rs
Rollup merge of #76858 - rcvalle:rust-lang-exploit-mitigations, r=steveklabnik
[rust.git] / src / test / ui / test-thread-capture.rs
1 // compile-flags: --test
2 // run-fail
3 // run-flags: --test-threads=1
4 // check-run-results
5 // exec-env:RUST_BACKTRACE=0
6 // ignore-emscripten no threads support
7
8 #[test]
9 fn thready_pass() {
10     println!("fee");
11     std::thread::spawn(|| {
12         println!("fie");
13         println!("foe");
14     })
15     .join()
16     .unwrap();
17     println!("fum");
18 }
19
20 #[test]
21 fn thready_fail() {
22     println!("fee");
23     std::thread::spawn(|| {
24         println!("fie");
25         println!("foe");
26     })
27     .join()
28     .unwrap();
29     println!("fum");
30     panic!();
31 }