Skip to content

Commit

Permalink
Fix compiler panic with a large number of threads
Browse files Browse the repository at this point in the history
  • Loading branch information
practicalrs committed Oct 30, 2024
1 parent 16422db commit ef30dab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,9 @@ mod parse {
true
}
Some(i) => {
*slot = i;
// We want to cap the number of threads here to avoid large numbers like 999999 and compiler panics.
// This solution was suggested here https://github.com/rust-lang/rust/issues/117638#issuecomment-1800925067
*slot = i.min(256);
true
}
None => false,
Expand Down

0 comments on commit ef30dab

Please sign in to comment.