Skip to content

Commit c2e84fa

Browse files
reduce default uninit_const_chunk_threshold to 16 (from 256)
1 parent d5769e9 commit c2e84fa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_session/src/options.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1485,9 +1485,9 @@ options! {
14851485
"in diagnostics, use heuristics to shorten paths referring to items"),
14861486
ui_testing: bool = (false, parse_bool, [UNTRACKED],
14871487
"emit compiler diagnostics in a form suitable for UI testing (default: no)"),
1488-
uninit_const_chunk_threshold: usize = (256, parse_number, [TRACKED],
1488+
uninit_const_chunk_threshold: usize = (16, parse_number, [TRACKED],
14891489
"allow generating const initializers with mixed init/uninit chunks, \
1490-
and set the maximum number of chunks for which this is allowed (default: 256)"),
1490+
and set the maximum number of chunks for which this is allowed (default: 16)"),
14911491
unleash_the_miri_inside_of_you: bool = (false, parse_bool, [TRACKED],
14921492
"take the brakes off const evaluation. NOTE: this is unsound (default: no)"),
14931493
unpretty: Option<String> = (None, parse_unpretty, [UNTRACKED],

src/test/codegen/uninit-consts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ pub struct PartiallyUninit {
1515

1616
// CHECK: [[PARTIALLY_UNINIT:@[0-9]+]] = private unnamed_addr constant <{ [4 x i8], [12 x i8] }> <{ [4 x i8] c"\EF\BE\AD\DE", [12 x i8] undef }>, align 4
1717

18-
// This shouldn't contain undef, since it contains more than 256 chunks
19-
// (the default value of uninit_const_chunk_threshold).
18+
// This shouldn't contain undef, since it contains more chunks
19+
// than the default value of uninit_const_chunk_threshold.
2020
// CHECK: [[UNINIT_PADDING_HUGE:@[0-9]+]] = private unnamed_addr constant <{ [32768 x i8] }> <{ [32768 x i8] c"{{.+}}" }>, align 4
2121

2222
// CHECK: [[FULLY_UNINIT_HUGE:@[0-9]+]] = private unnamed_addr constant <{ [16384 x i8] }> undef

0 commit comments

Comments
 (0)