@@ -835,7 +835,7 @@ def bootstrap_binary(self):
835
835
"""
836
836
return os .path .join (self .build_dir , "bootstrap" , "debug" , "bootstrap" )
837
837
838
- def build_bootstrap (self , color , verbose_count ):
838
+ def build_bootstrap (self , color , warnings , verbose_count ):
839
839
"""Build bootstrap"""
840
840
env = os .environ .copy ()
841
841
if "GITHUB_ACTIONS" in env :
@@ -894,7 +894,11 @@ def build_bootstrap(self, color, verbose_count):
894
894
if target_linker is not None :
895
895
env ["RUSTFLAGS" ] += " -C linker=" + target_linker
896
896
env ["RUSTFLAGS" ] += " -Wrust_2018_idioms -Wunused_lifetimes"
897
- if self .get_toml ("deny-warnings" , "rust" ) != "false" :
897
+ if warnings == "default" :
898
+ deny_warnings = self .get_toml ("deny-warnings" , "rust" ) != "false"
899
+ else :
900
+ deny_warnings = warnings == "deny"
901
+ if deny_warnings :
898
902
env ["RUSTFLAGS" ] += " -Dwarnings"
899
903
900
904
env ["PATH" ] = os .path .join (self .bin_root (), "bin" ) + \
@@ -987,6 +991,7 @@ def parse_args():
987
991
parser .add_argument ('--color' , choices = ['always' , 'never' , 'auto' ])
988
992
parser .add_argument ('--clean' , action = 'store_true' )
989
993
parser .add_argument ('--json-output' , action = 'store_true' )
994
+ parser .add_argument ('--warnings' , choices = ['deny' , 'warn' , 'default' ], default = 'default' )
990
995
parser .add_argument ('-v' , '--verbose' , action = 'count' , default = 0 )
991
996
992
997
return parser .parse_known_args (sys .argv )[0 ]
@@ -1052,7 +1057,7 @@ def bootstrap(args):
1052
1057
# Fetch/build the bootstrap
1053
1058
build .download_toolchain ()
1054
1059
sys .stdout .flush ()
1055
- build .build_bootstrap (args .color , verbose_count )
1060
+ build .build_bootstrap (args .color , args . warnings , verbose_count )
1056
1061
sys .stdout .flush ()
1057
1062
1058
1063
# Run the bootstrap
0 commit comments