@@ -71,6 +71,8 @@ pub struct Config {
71
71
pub incremental : bool ,
72
72
pub dry_run : bool ,
73
73
74
+ pub deny_warnings : bool ,
75
+
74
76
// llvm codegen options
75
77
pub llvm_enabled : bool ,
76
78
pub llvm_assertions : bool ,
@@ -301,6 +303,7 @@ struct Rust {
301
303
codegen_backends_dir : Option < String > ,
302
304
wasm_syscall : Option < bool > ,
303
305
lld : Option < bool > ,
306
+ deny_warnings : Option < bool > ,
304
307
}
305
308
306
309
/// TOML representation of how each build target is configured.
@@ -340,6 +343,7 @@ impl Config {
340
343
config. test_miri = false ;
341
344
config. rust_codegen_backends = vec ! [ INTERNER . intern_str( "llvm" ) ] ;
342
345
config. rust_codegen_backends_dir = "codegen-backends" . to_owned ( ) ;
346
+ config. deny_warnings = true ;
343
347
344
348
// set by bootstrap.py
345
349
config. src = env:: var_os ( "SRC" ) . map ( PathBuf :: from) . expect ( "'SRC' to be set" ) ;
@@ -366,6 +370,9 @@ impl Config {
366
370
config. incremental = flags. incremental ;
367
371
config. dry_run = flags. dry_run ;
368
372
config. keep_stage = flags. keep_stage ;
373
+ if let Some ( value) = flags. warnings {
374
+ config. deny_warnings = value;
375
+ }
369
376
370
377
if config. dry_run {
371
378
let dir = config. out . join ( "tmp-dry-run" ) ;
@@ -511,6 +518,7 @@ impl Config {
511
518
config. rustc_default_linker = rust. default_linker . clone ( ) ;
512
519
config. musl_root = rust. musl_root . clone ( ) . map ( PathBuf :: from) ;
513
520
config. save_toolstates = rust. save_toolstates . clone ( ) . map ( PathBuf :: from) ;
521
+ set ( & mut config. deny_warnings , rust. deny_warnings . or ( flags. warnings ) ) ;
514
522
515
523
if let Some ( ref backends) = rust. codegen_backends {
516
524
config. rust_codegen_backends = backends. iter ( )
0 commit comments