@@ -413,7 +413,8 @@ mod desc {
413
413
pub const parse_merge_functions: & str = "one of: `disabled`, `trampolines`, or `aliases`" ;
414
414
pub const parse_symbol_mangling_version: & str =
415
415
"one of: `legacy`, `v0` (RFC 2603), or `hashed`" ;
416
- pub const parse_src_file_hash: & str = "either `md5`, `sha1`, or `sha256`" ;
416
+ pub const parse_cargo_src_file_hash: & str = "one of `sha256`" ;
417
+ pub const parse_src_file_hash: & str = "one of `md5`, `sha1`, or `sha256`" ;
417
418
pub const parse_relocation_model: & str =
418
419
"one of supported relocation models (`rustc --print relocation-models`)" ;
419
420
pub const parse_code_model: & str = "one of supported code models (`rustc --print code-models`)" ;
@@ -1261,6 +1262,23 @@ mod parse {
1261
1262
true
1262
1263
}
1263
1264
1265
+ pub ( crate ) fn parse_cargo_src_file_hash (
1266
+ slot : & mut Option < SourceFileHashAlgorithm > ,
1267
+ v : Option < & str > ,
1268
+ ) -> bool {
1269
+ match v. and_then ( |s| SourceFileHashAlgorithm :: from_str ( s) . ok ( ) ) {
1270
+ Some ( hash_kind) => {
1271
+ if hash_kind. supported_in_cargo ( ) {
1272
+ * slot = Some ( hash_kind) ;
1273
+ } else {
1274
+ return false ;
1275
+ }
1276
+ }
1277
+ _ => return false ,
1278
+ }
1279
+ true
1280
+ }
1281
+
1264
1282
pub ( crate ) fn parse_target_feature ( slot : & mut String , v : Option < & str > ) -> bool {
1265
1283
match v {
1266
1284
Some ( s) => {
@@ -1647,8 +1665,8 @@ options! {
1647
1665
"instrument control-flow architecture protection" ) ,
1648
1666
check_cfg_all_expected: bool = ( false , parse_bool, [ UNTRACKED ] ,
1649
1667
"show all expected values in check-cfg diagnostics (default: no)" ) ,
1650
- checksum_hash_algorithm: Option <SourceFileHashAlgorithm > = ( None , parse_src_file_hash , [ TRACKED ] ,
1651
- "hash algorithm of source files used to check freshness in cargo (`md5`, `sha1`, or ` sha256`)" ) ,
1668
+ checksum_hash_algorithm: Option <SourceFileHashAlgorithm > = ( None , parse_cargo_src_file_hash , [ TRACKED ] ,
1669
+ "hash algorithm of source files used to check freshness in cargo (`sha256`)" ) ,
1652
1670
codegen_backend: Option <String > = ( None , parse_opt_string, [ TRACKED ] ,
1653
1671
"the backend to use" ) ,
1654
1672
combine_cgu: bool = ( false , parse_bool, [ TRACKED ] ,
0 commit comments