Skip to content

Commit

Permalink
reduce default uninit_const_chunk_threshold to 16 (from 256)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikdesjardins committed Feb 19, 2022
1 parent d5769e9 commit c2e84fa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_session/src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1485,9 +1485,9 @@ options! {
"in diagnostics, use heuristics to shorten paths referring to items"),
ui_testing: bool = (false, parse_bool, [UNTRACKED],
"emit compiler diagnostics in a form suitable for UI testing (default: no)"),
uninit_const_chunk_threshold: usize = (256, parse_number, [TRACKED],
uninit_const_chunk_threshold: usize = (16, parse_number, [TRACKED],
"allow generating const initializers with mixed init/uninit chunks, \
and set the maximum number of chunks for which this is allowed (default: 256)"),
and set the maximum number of chunks for which this is allowed (default: 16)"),
unleash_the_miri_inside_of_you: bool = (false, parse_bool, [TRACKED],
"take the brakes off const evaluation. NOTE: this is unsound (default: no)"),
unpretty: Option<String> = (None, parse_unpretty, [UNTRACKED],
Expand Down
4 changes: 2 additions & 2 deletions src/test/codegen/uninit-consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ pub struct PartiallyUninit {

// 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

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

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

0 comments on commit c2e84fa

Please sign in to comment.