Skip to content

Commit ddeda45

Browse files
oli-obkpietroalbini
authored andcommitted
Bump stack size to 32MB
1 parent bdb3f53 commit ddeda45

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/librustc_driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ pub fn spawn_thread_pool<F: FnOnce(config::Options) -> R + sync::Send, R: sync::
9191
let config = ThreadPoolBuilder::new()
9292
.num_threads(Session::query_threads_from_opts(&opts))
9393
.deadlock_handler(|| unsafe { ty::query::handle_deadlock() })
94-
.stack_size(16 * 1024 * 1024);
94+
.stack_size(::STACK_SIZE);
9595

9696
let with_pool = move |pool: &ThreadPool| {
9797
pool.install(move || f(opts))

src/librustc_driver/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1460,6 +1460,11 @@ fn parse_crate_attrs<'a>(sess: &'a Session, input: &Input) -> PResult<'a, Vec<as
14601460
}
14611461
}
14621462

1463+
// Temporarily have stack size set to 32MB to deal with various crates with long method
1464+
// chains or deep syntax trees.
1465+
// FIXME(oli-obk): get https://github.com/rust-lang/rust/pull/55617 the finish line
1466+
const STACK_SIZE: usize = 32 * 1024 * 1024; // 32MB
1467+
14631468
/// Runs `f` in a suitable thread for running `rustc`; returns a `Result` with either the return
14641469
/// value of `f` or -- if a panic occurs -- the panic value.
14651470
///
@@ -1469,9 +1474,6 @@ pub fn in_named_rustc_thread<F, R>(name: String, f: F) -> Result<R, Box<dyn Any
14691474
where F: FnOnce() -> R + Send + 'static,
14701475
R: Send + 'static,
14711476
{
1472-
// Temporarily have stack size set to 16MB to deal with nom-using crates failing
1473-
const STACK_SIZE: usize = 16 * 1024 * 1024; // 16MB
1474-
14751477
#[cfg(all(unix, not(target_os = "haiku")))]
14761478
let spawn_thread = unsafe {
14771479
// Fetch the current resource limits

0 commit comments

Comments
 (0)