@@ -1767,6 +1767,29 @@ impl Config {
1767
1767
std_features : std_features_toml,
1768
1768
} = rust;
1769
1769
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
+
1770
1793
config. download_rustc_commit =
1771
1794
config. download_ci_rustc_commit ( download_rustc, config. llvm_assertions ) ;
1772
1795
@@ -2172,7 +2195,9 @@ impl Config {
2172
2195
config. rust_std_features = std_features. unwrap_or ( default_std_features) ;
2173
2196
2174
2197
let default = debug == Some ( true ) ;
2198
+
2175
2199
config. rustc_debug_assertions = rustc_debug_assertions. unwrap_or ( default) ;
2200
+
2176
2201
config. std_debug_assertions = std_debug_assertions. unwrap_or ( config. rustc_debug_assertions ) ;
2177
2202
config. rust_overflow_checks = overflow_checks. unwrap_or ( default) ;
2178
2203
config. rust_overflow_checks_std =
0 commit comments