@@ -412,7 +412,8 @@ mod desc {
412
412
pub const parse_merge_functions: & str = "one of: `disabled`, `trampolines`, or `aliases`" ;
413
413
pub const parse_symbol_mangling_version: & str =
414
414
"one of: `legacy`, `v0` (RFC 2603), or `hashed`" ;
415
- pub const parse_src_file_hash: & str = "either `md5`, `sha1`, or `sha256`" ;
415
+ pub const parse_cargo_src_file_hash: & str = "one of `sha256`" ;
416
+ pub const parse_src_file_hash: & str = "one of `md5`, `sha1`, or `sha256`" ;
416
417
pub const parse_relocation_model: & str =
417
418
"one of supported relocation models (`rustc --print relocation-models`)" ;
418
419
pub const parse_code_model: & str = "one of supported code models (`rustc --print code-models`)" ;
@@ -1222,6 +1223,23 @@ mod parse {
1222
1223
true
1223
1224
}
1224
1225
1226
+ pub ( crate ) fn parse_cargo_src_file_hash (
1227
+ slot : & mut Option < SourceFileHashAlgorithm > ,
1228
+ v : Option < & str > ,
1229
+ ) -> bool {
1230
+ match v. and_then ( |s| SourceFileHashAlgorithm :: from_str ( s) . ok ( ) ) {
1231
+ Some ( hash_kind) => {
1232
+ if hash_kind. supported_in_cargo ( ) {
1233
+ * slot = Some ( hash_kind) ;
1234
+ } else {
1235
+ return false ;
1236
+ }
1237
+ }
1238
+ _ => return false ,
1239
+ }
1240
+ true
1241
+ }
1242
+
1225
1243
pub ( crate ) fn parse_target_feature ( slot : & mut String , v : Option < & str > ) -> bool {
1226
1244
match v {
1227
1245
Some ( s) => {
@@ -1609,8 +1627,8 @@ options! {
1609
1627
"instrument control-flow architecture protection" ) ,
1610
1628
check_cfg_all_expected: bool = ( false , parse_bool, [ UNTRACKED ] ,
1611
1629
"show all expected values in check-cfg diagnostics (default: no)" ) ,
1612
- checksum_hash_algorithm: Option <SourceFileHashAlgorithm > = ( None , parse_src_file_hash , [ TRACKED ] ,
1613
- "hash algorithm of source files used to check freshness in cargo (`md5`, `sha1`, or ` sha256`)" ) ,
1630
+ checksum_hash_algorithm: Option <SourceFileHashAlgorithm > = ( None , parse_cargo_src_file_hash , [ TRACKED ] ,
1631
+ "hash algorithm of source files used to check freshness in cargo (`sha256`)" ) ,
1614
1632
codegen_backend: Option <String > = ( None , parse_opt_string, [ TRACKED ] ,
1615
1633
"the backend to use" ) ,
1616
1634
combine_cgu: bool = ( false , parse_bool, [ TRACKED ] ,
0 commit comments