Skip to content

Commit c2d1cac

Browse files
author
Yuki Okushi
authored
Rollup merge of #106671 - tmiasko:opt-bool, r=wesleywiser
Change flags with a fixed default value from Option<bool> to bool
2 parents 0e92e1d + 72f8d6a commit c2d1cac

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Diff for: compiler/rustc_interface/src/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ fn test_unstable_options_tracking_hash() {
715715
tracked!(asm_comments, true);
716716
tracked!(assume_incomplete_release, true);
717717
tracked!(binary_dep_depinfo, true);
718-
tracked!(box_noalias, Some(false));
718+
tracked!(box_noalias, false);
719719
tracked!(
720720
branch_protection,
721721
Some(BranchProtection {
@@ -754,7 +754,7 @@ fn test_unstable_options_tracking_hash() {
754754
tracked!(mir_enable_passes, vec![("DestProp".to_string(), false)]);
755755
tracked!(mir_opt_level, Some(4));
756756
tracked!(move_size_limit, Some(4096));
757-
tracked!(mutable_noalias, Some(true));
757+
tracked!(mutable_noalias, false);
758758
tracked!(no_generate_arange_section, true);
759759
tracked!(no_jump_tables, true);
760760
tracked!(no_link, true);

Diff for: compiler/rustc_session/src/options.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ options! {
12551255
binary_dep_depinfo: bool = (false, parse_bool, [TRACKED],
12561256
"include artifacts (sysroot, crate dependencies) used during compilation in dep-info \
12571257
(default: no)"),
1258-
box_noalias: Option<bool> = (None, parse_opt_bool, [TRACKED],
1258+
box_noalias: bool = (true, parse_bool, [TRACKED],
12591259
"emit noalias metadata for box (default: yes)"),
12601260
branch_protection: Option<BranchProtection> = (None, parse_branch_protection, [TRACKED],
12611261
"set options for branch target identification and pointer authentication on AArch64"),
@@ -1437,7 +1437,7 @@ options! {
14371437
"use line numbers relative to the function in mir pretty printing"),
14381438
move_size_limit: Option<usize> = (None, parse_opt_number, [TRACKED],
14391439
"the size at which the `large_assignments` lint starts to be emitted"),
1440-
mutable_noalias: Option<bool> = (None, parse_opt_bool, [TRACKED],
1440+
mutable_noalias: bool = (true, parse_bool, [TRACKED],
14411441
"emit noalias metadata for mutable references (default: yes)"),
14421442
nll_facts: bool = (false, parse_bool, [UNTRACKED],
14431443
"dump facts from NLL analysis into side files (default: no)"),

Diff for: compiler/rustc_ty_utils/src/abi.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,12 @@ fn adjust_for_rust_scalar<'tcx>(
254254
// The aliasing rules for `Box<T>` are still not decided, but currently we emit
255255
// `noalias` for it. This can be turned off using an unstable flag.
256256
// See https://github.com/rust-lang/unsafe-code-guidelines/issues/326
257-
let noalias_for_box = cx.tcx.sess.opts.unstable_opts.box_noalias.unwrap_or(true);
257+
let noalias_for_box = cx.tcx.sess.opts.unstable_opts.box_noalias;
258258

259259
// LLVM prior to version 12 had known miscompiles in the presence of noalias attributes
260260
// (see #54878), so it was conditionally disabled, but we don't support earlier
261261
// versions at all anymore. We still support turning it off using -Zmutable-noalias.
262-
let noalias_mut_ref = cx.tcx.sess.opts.unstable_opts.mutable_noalias.unwrap_or(true);
262+
let noalias_mut_ref = cx.tcx.sess.opts.unstable_opts.mutable_noalias;
263263

264264
// `&mut` pointer parameters never alias other parameters,
265265
// or mutable global data

0 commit comments

Comments
 (0)