@@ -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 :
@@ -888,7 +888,11 @@ def build_bootstrap(self, color, verbose_count):
888
888
if target_linker is not None :
889
889
env ["RUSTFLAGS" ] += " -C linker=" + target_linker
890
890
env ["RUSTFLAGS" ] += " -Wrust_2018_idioms -Wunused_lifetimes"
891
- if self .get_toml ("deny-warnings" , "rust" ) != "false" :
891
+ if warnings == "default" :
892
+ deny_warnings = self .get_toml ("deny-warnings" , "rust" ) != "false"
893
+ else :
894
+ deny_warnings = warnings == "deny"
895
+ if deny_warnings :
892
896
env ["RUSTFLAGS" ] += " -Dwarnings"
893
897
894
898
env ["PATH" ] = os .path .join (self .bin_root (), "bin" ) + \
@@ -977,6 +981,7 @@ def parse_args():
977
981
parser .add_argument ('--color' , choices = ['always' , 'never' , 'auto' ])
978
982
parser .add_argument ('--clean' , action = 'store_true' )
979
983
parser .add_argument ('--json-output' , action = 'store_true' )
984
+ parser .add_argument ('--warnings' , choices = ['deny' , 'warn' , 'default' ], default = 'default' )
980
985
parser .add_argument ('-v' , '--verbose' , action = 'count' , default = 0 )
981
986
982
987
return parser .parse_known_args (sys .argv )[0 ]
@@ -1042,7 +1047,7 @@ def bootstrap(args):
1042
1047
# Fetch/build the bootstrap
1043
1048
build .download_toolchain ()
1044
1049
sys .stdout .flush ()
1045
- build .build_bootstrap (args .color , verbose_count )
1050
+ build .build_bootstrap (args .color , args . warnings , verbose_count )
1046
1051
sys .stdout .flush ()
1047
1052
1048
1053
# Run the bootstrap
0 commit comments