Skip to content

Commit d77c4f2

Browse files
committed
bootstrap: pass --with-{rustc,std}-debug-assertions to compiletest
And rename local variables and field names in bootstrap from `debug_assertions{,_std}` -> `{rustc,std}-debug-assertions` to avoid confusion where applicable.
1 parent 012c7eb commit d77c4f2

File tree

3 files changed

+26
-21
lines changed

3 files changed

+26
-21
lines changed

src/bootstrap/src/core/build_steps/test.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -1928,9 +1928,13 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
19281928

19291929
cmd.arg("--json");
19301930

1931-
if builder.config.rust_debug_assertions_std {
1932-
cmd.arg("--with-debug-assertions");
1933-
};
1931+
if builder.config.rustc_debug_assertions {
1932+
cmd.arg("--with-rustc-debug-assertions");
1933+
}
1934+
1935+
if builder.config.std_debug_assertions {
1936+
cmd.arg("--with-std-debug-assertions");
1937+
}
19341938

19351939
let mut llvm_components_passed = false;
19361940
let mut copts_passed = false;

src/bootstrap/src/core/builder/cargo.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -833,9 +833,9 @@ impl Builder<'_> {
833833
cargo.env(
834834
profile_var("DEBUG_ASSERTIONS"),
835835
if mode == Mode::Std {
836-
self.config.rust_debug_assertions_std.to_string()
836+
self.config.std_debug_assertions.to_string()
837837
} else {
838-
self.config.rust_debug_assertions.to_string()
838+
self.config.rustc_debug_assertions.to_string()
839839
},
840840
);
841841
cargo.env(

src/bootstrap/src/core/config/config.rs

+17-16
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,10 @@ pub struct Config {
262262
pub rust_optimize: RustOptimize,
263263
pub rust_codegen_units: Option<u32>,
264264
pub rust_codegen_units_std: Option<u32>,
265-
pub rust_debug_assertions: bool,
266-
pub rust_debug_assertions_std: bool,
265+
266+
pub rustc_debug_assertions: bool,
267+
pub std_debug_assertions: bool,
268+
267269
pub rust_overflow_checks: bool,
268270
pub rust_overflow_checks_std: bool,
269271
pub rust_debug_logging: bool,
@@ -1109,9 +1111,9 @@ define_config! {
11091111
debug: Option<bool> = "debug",
11101112
codegen_units: Option<u32> = "codegen-units",
11111113
codegen_units_std: Option<u32> = "codegen-units-std",
1112-
debug_assertions: Option<bool> = "debug-assertions",
1114+
rustc_debug_assertions: Option<bool> = "debug-assertions",
11131115
randomize_layout: Option<bool> = "randomize-layout",
1114-
debug_assertions_std: Option<bool> = "debug-assertions-std",
1116+
std_debug_assertions: Option<bool> = "debug-assertions-std",
11151117
overflow_checks: Option<bool> = "overflow-checks",
11161118
overflow_checks_std: Option<bool> = "overflow-checks-std",
11171119
debug_logging: Option<bool> = "debug-logging",
@@ -1644,8 +1646,8 @@ impl Config {
16441646
let mut llvm_enzyme = None;
16451647
let mut llvm_plugins = None;
16461648
let mut debug = None;
1647-
let mut debug_assertions = None;
1648-
let mut debug_assertions_std = None;
1649+
let mut rustc_debug_assertions = None;
1650+
let mut std_debug_assertions = None;
16491651
let mut overflow_checks = None;
16501652
let mut overflow_checks_std = None;
16511653
let mut debug_logging = None;
@@ -1667,8 +1669,8 @@ impl Config {
16671669
debug: debug_toml,
16681670
codegen_units,
16691671
codegen_units_std,
1670-
debug_assertions: debug_assertions_toml,
1671-
debug_assertions_std: debug_assertions_std_toml,
1672+
rustc_debug_assertions: rustc_debug_assertions_toml,
1673+
std_debug_assertions: std_debug_assertions_toml,
16721674
overflow_checks: overflow_checks_toml,
16731675
overflow_checks_std: overflow_checks_std_toml,
16741676
debug_logging: debug_logging_toml,
@@ -1726,8 +1728,8 @@ impl Config {
17261728
config.download_ci_rustc_commit(download_rustc, config.llvm_assertions);
17271729

17281730
debug = debug_toml;
1729-
debug_assertions = debug_assertions_toml;
1730-
debug_assertions_std = debug_assertions_std_toml;
1731+
rustc_debug_assertions = rustc_debug_assertions_toml;
1732+
std_debug_assertions = std_debug_assertions_toml;
17311733
overflow_checks = overflow_checks_toml;
17321734
overflow_checks_std = overflow_checks_std_toml;
17331735
debug_logging = debug_logging_toml;
@@ -2136,14 +2138,13 @@ impl Config {
21362138
config.rust_std_features = std_features.unwrap_or(default_std_features);
21372139

21382140
let default = debug == Some(true);
2139-
config.rust_debug_assertions = debug_assertions.unwrap_or(default);
2140-
config.rust_debug_assertions_std =
2141-
debug_assertions_std.unwrap_or(config.rust_debug_assertions);
2141+
config.rustc_debug_assertions = rustc_debug_assertions.unwrap_or(default);
2142+
config.std_debug_assertions = std_debug_assertions.unwrap_or(config.std_debug_assertions);
21422143
config.rust_overflow_checks = overflow_checks.unwrap_or(default);
21432144
config.rust_overflow_checks_std =
21442145
overflow_checks_std.unwrap_or(config.rust_overflow_checks);
21452146

2146-
config.rust_debug_logging = debug_logging.unwrap_or(config.rust_debug_assertions);
2147+
config.rust_debug_logging = debug_logging.unwrap_or(config.rustc_debug_assertions);
21472148

21482149
let with_defaults = |debuginfo_level_specific: Option<_>| {
21492150
debuginfo_level_specific.or(debuginfo_level).unwrap_or(if debug == Some(true) {
@@ -3084,8 +3085,8 @@ fn check_incompatible_options_for_ci_rustc(
30843085
debug: _,
30853086
codegen_units: _,
30863087
codegen_units_std: _,
3087-
debug_assertions: _,
3088-
debug_assertions_std: _,
3088+
rustc_debug_assertions: _,
3089+
std_debug_assertions: _,
30893090
overflow_checks: _,
30903091
overflow_checks_std: _,
30913092
debuginfo_level: _,

0 commit comments

Comments
 (0)