]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-2190-1.rs
Require Drop impls to have the same constness on its bounds as the bounds on the...
[rust.git] / src / test / ui / issues / issue-2190-1.rs
1 // run-pass
2 #![allow(unused_must_use)]
3 #![allow(non_upper_case_globals)]
4
5 // pretty-expanded FIXME #23616
6 // ignore-emscripten no threads
7
8 use std::thread::Builder;
9
10 static generations: usize = 1024+256+128+49;
11
12 fn spawn(mut f: Box<dyn FnMut() + 'static + Send>) {
13     Builder::new().stack_size(32 * 1024).spawn(move|| f());
14 }
15
16 fn child_no(x: usize) -> Box<dyn FnMut() + 'static + Send> {
17     Box::new(move|| {
18         if x < generations {
19             spawn(child_no(x+1));
20         }
21     })
22 }
23
24 pub fn main() {
25     spawn(child_no(0));
26 }