Skip to content

Commit 818099c

Browse files
committed
Fix compiler panic with a large number of threads - address comment
1 parent b899dbc commit 818099c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

compiler/rustc_session/src/options.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -665,11 +665,7 @@ mod parse {
665665
Some(i) => {
666666
// We want to cap the number of threads here to avoid large numbers like 999999 and compiler panics.
667667
// This solution was suggested here https://github.com/rust-lang/rust/issues/117638#issuecomment-1800925067
668-
if i <= 256 {
669-
*slot = i;
670-
} else {
671-
*slot = 256;
672-
}
668+
*slot = i.min(256);
673669
true
674670
}
675671
None => false,

0 commit comments

Comments
 (0)