Skip to content

Commit 3870022

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 65b986b commit 3870022

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
@@ -1933,9 +1933,13 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
19331933

19341934
cmd.arg("--json");
19351935

1936-
if builder.config.rust_debug_assertions_std {
1937-
cmd.arg("--with-debug-assertions");
1938-
};
1936+
if builder.config.rustc_debug_assertions {
1937+
cmd.arg("--with-rustc-debug-assertions");
1938+
}
1939+
1940+
if builder.config.std_debug_assertions {
1941+
cmd.arg("--with-std-debug-assertions");
1942+
}
19391943

19401944
let mut llvm_components_passed = false;
19411945
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
@@ -263,8 +263,10 @@ pub struct Config {
263263
pub rust_optimize: RustOptimize,
264264
pub rust_codegen_units: Option<u32>,
265265
pub rust_codegen_units_std: Option<u32>,
266-
pub rust_debug_assertions: bool,
267-
pub rust_debug_assertions_std: bool,
266+
267+
pub rustc_debug_assertions: bool,
268+
pub std_debug_assertions: bool,
269+
268270
pub rust_overflow_checks: bool,
269271
pub rust_overflow_checks_std: bool,
270272
pub rust_debug_logging: bool,
@@ -1115,9 +1117,9 @@ define_config! {
11151117
debug: Option<bool> = "debug",
11161118
codegen_units: Option<u32> = "codegen-units",
11171119
codegen_units_std: Option<u32> = "codegen-units-std",
1118-
debug_assertions: Option<bool> = "debug-assertions",
1120+
rustc_debug_assertions: Option<bool> = "debug-assertions",
11191121
randomize_layout: Option<bool> = "randomize-layout",
1120-
debug_assertions_std: Option<bool> = "debug-assertions-std",
1122+
std_debug_assertions: Option<bool> = "debug-assertions-std",
11211123
overflow_checks: Option<bool> = "overflow-checks",
11221124
overflow_checks_std: Option<bool> = "overflow-checks-std",
11231125
debug_logging: Option<bool> = "debug-logging",
@@ -1652,8 +1654,8 @@ impl Config {
16521654
let mut llvm_offload = None;
16531655
let mut llvm_plugins = None;
16541656
let mut debug = None;
1655-
let mut debug_assertions = None;
1656-
let mut debug_assertions_std = None;
1657+
let mut rustc_debug_assertions = None;
1658+
let mut std_debug_assertions = None;
16571659
let mut overflow_checks = None;
16581660
let mut overflow_checks_std = None;
16591661
let mut debug_logging = None;
@@ -1675,8 +1677,8 @@ impl Config {
16751677
debug: debug_toml,
16761678
codegen_units,
16771679
codegen_units_std,
1678-
debug_assertions: debug_assertions_toml,
1679-
debug_assertions_std: debug_assertions_std_toml,
1680+
rustc_debug_assertions: rustc_debug_assertions_toml,
1681+
std_debug_assertions: std_debug_assertions_toml,
16801682
overflow_checks: overflow_checks_toml,
16811683
overflow_checks_std: overflow_checks_std_toml,
16821684
debug_logging: debug_logging_toml,
@@ -1734,8 +1736,8 @@ impl Config {
17341736
config.download_ci_rustc_commit(download_rustc, config.llvm_assertions);
17351737

17361738
debug = debug_toml;
1737-
debug_assertions = debug_assertions_toml;
1738-
debug_assertions_std = debug_assertions_std_toml;
1739+
rustc_debug_assertions = rustc_debug_assertions_toml;
1740+
std_debug_assertions = std_debug_assertions_toml;
17391741
overflow_checks = overflow_checks_toml;
17401742
overflow_checks_std = overflow_checks_std_toml;
17411743
debug_logging = debug_logging_toml;
@@ -2148,14 +2150,13 @@ impl Config {
21482150
config.rust_std_features = std_features.unwrap_or(default_std_features);
21492151

21502152
let default = debug == Some(true);
2151-
config.rust_debug_assertions = debug_assertions.unwrap_or(default);
2152-
config.rust_debug_assertions_std =
2153-
debug_assertions_std.unwrap_or(config.rust_debug_assertions);
2153+
config.rustc_debug_assertions = rustc_debug_assertions.unwrap_or(default);
2154+
config.std_debug_assertions = std_debug_assertions.unwrap_or(config.rustc_debug_assertions);
21542155
config.rust_overflow_checks = overflow_checks.unwrap_or(default);
21552156
config.rust_overflow_checks_std =
21562157
overflow_checks_std.unwrap_or(config.rust_overflow_checks);
21572158

2158-
config.rust_debug_logging = debug_logging.unwrap_or(config.rust_debug_assertions);
2159+
config.rust_debug_logging = debug_logging.unwrap_or(config.rustc_debug_assertions);
21592160

21602161
let with_defaults = |debuginfo_level_specific: Option<_>| {
21612162
debuginfo_level_specific.or(debuginfo_level).unwrap_or(if debug == Some(true) {
@@ -3075,8 +3076,8 @@ fn check_incompatible_options_for_ci_rustc(
30753076
debug: _,
30763077
codegen_units: _,
30773078
codegen_units_std: _,
3078-
debug_assertions: _,
3079-
debug_assertions_std: _,
3079+
rustc_debug_assertions: _,
3080+
std_debug_assertions: _,
30803081
overflow_checks: _,
30813082
overflow_checks_std: _,
30823083
debuginfo_level: _,

0 commit comments

Comments
 (0)