File tree Expand file tree Collapse file tree 1 file changed +9
-20
lines changed
compiler/rustc_session/src Expand file tree Collapse file tree 1 file changed +9
-20
lines changed Original file line number Diff line number Diff line change @@ -943,32 +943,21 @@ mod parse {
943
943
pub ( crate ) fn parse_coverage_options ( slot : & mut CoverageOptions , v : Option < & str > ) -> bool {
944
944
let Some ( v) = v else { return true } ;
945
945
946
- let set_branch_option = | slot : & mut CoverageOptions , option : & str | {
946
+ for option in v . split ( ',' ) {
947
947
match option {
948
- "no-branch" => slot. branch = false ,
949
- "branch" => slot. branch = true ,
948
+ "no-branch" => {
949
+ slot. branch = false ;
950
+ }
951
+ "branch" => {
952
+ slot. branch = true ;
953
+ }
950
954
"mcdc" => {
951
- slot. mcdc = true ;
952
- slot. branch = true
955
+ slot. branch = true ;
956
+ slot. mcdc = true
953
957
}
954
958
_ => return false ,
955
959
}
956
- true
957
- } ;
958
-
959
- // Once an option is parsed we removed it from the array so that conflicting options such as "branch,no-branch" could be detected.
960
- let mut parsers_set: [ Option < & dyn Fn ( & mut CoverageOptions , & str ) -> bool > ; 1 ] =
961
- [ Some ( & set_branch_option) ] ;
962
-
963
- for option in v. split ( ',' ) {
964
- if !parsers_set
965
- . iter_mut ( )
966
- . any ( |p| p. is_some_and ( |parser| parser ( slot, option) ) . then ( || p. take ( ) ) . is_some ( ) )
967
- {
968
- return false ;
969
- }
970
960
}
971
-
972
961
true
973
962
}
974
963
You can’t perform that action at this time.
0 commit comments