Skip to content

Commit da8023d

Browse files
committed
Change init-large-type to use child thread
1 parent a506d4c commit da8023d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/test/run-pass/init-large-type.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,17 @@
1414

1515
#![feature(intrinsics)]
1616

17+
use std::thread::Thread;
18+
1719
extern "rust-intrinsic" {
1820
pub fn init<T>() -> T;
1921
}
2022

2123
const SIZE: usize = 1024 * 1024;
2224

2325
fn main() {
24-
let _memory: [u8; SIZE] = unsafe { init() };
26+
// do the test in a new thread to avoid (spurious?) stack overflows
27+
let _ = Thread::scoped(|| {
28+
let _memory: [u8; SIZE] = unsafe { init() };
29+
}).join();
2530
}

0 commit comments

Comments
 (0)