@@ -1767,6 +1767,29 @@ impl Config {
17671767 std_features : std_features_toml,
17681768 } = rust;
17691769
1770+ // Before something like [Enable debug assertions on alt
1771+ // builds](https://github.com/rust-lang/rust/pull/131077) lands, alt rustc builds do
1772+ // *not* have rustc debug assertions enabled. We must not download an CI alt rustc if we
1773+ // need rustc to have debug assertions (e.g. for crashes test suite).
1774+ //
1775+ // Note that `rust.debug = true` (currently) implies `rust.debug-assertions = true`!
1776+ //
1777+ // This relies also on the fact that global default for `download-rustc` will be `false`
1778+ // if it's not explicitly set.
1779+ if matches ! ( rustc_debug_assertions, Some ( true ) )
1780+ || ( matches ! ( debug, Some ( true ) ) && rustc_debug_assertions. is_none ( ) )
1781+ {
1782+ if let Some ( ref opt) = download_rustc {
1783+ if opt. is_string_or_true ( ) {
1784+ panic ! (
1785+ "ERROR: currently no CI rustc builds have rustc debug assertions\
1786+ enabled. Please either set `rust.debug-assertions` to `false` or set \
1787+ `rust.download-rustc` to `false`."
1788+ ) ;
1789+ }
1790+ }
1791+ }
1792+
17701793 config. download_rustc_commit =
17711794 config. download_ci_rustc_commit ( download_rustc, config. llvm_assertions ) ;
17721795
@@ -2172,7 +2195,9 @@ impl Config {
21722195 config. rust_std_features = std_features. unwrap_or ( default_std_features) ;
21732196
21742197 let default = debug == Some ( true ) ;
2198+
21752199 config. rustc_debug_assertions = rustc_debug_assertions. unwrap_or ( default) ;
2200+
21762201 config. std_debug_assertions = std_debug_assertions. unwrap_or ( config. rustc_debug_assertions ) ;
21772202 config. rust_overflow_checks = overflow_checks. unwrap_or ( default) ;
21782203 config. rust_overflow_checks_std =
0 commit comments