File tree 1 file changed +6
-5
lines changed
src/tools/miropt-test-tools/src
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -98,11 +98,12 @@ pub fn files_for_miropt_test(
98
98
from_file = format ! ( "{}.{}.mir" , test_name, first_pass) ;
99
99
to_file = Some ( second_file) ;
100
100
} else {
101
- let ext_re = regex:: Regex :: new ( r#"(\.(mir|dot|html))$"# ) . unwrap ( ) ;
102
- let cap = ext_re
103
- . captures_iter ( test_name)
104
- . next ( )
105
- . expect ( "test_name has an invalid extension" ) ;
101
+ // Allow-list for file extensions that can be produced by MIR dumps.
102
+ // Other extensions can be added here, as needed by new dump flags.
103
+ let ext_re = regex:: Regex :: new ( r#"(\.(mir|dot))$"# ) . unwrap ( ) ;
104
+ let cap = ext_re. captures_iter ( test_name) . next ( ) . unwrap_or_else ( || {
105
+ panic ! ( "in {testfile:?}:\n EMIT_MIR has an unrecognized extension: {test_name}" )
106
+ } ) ;
106
107
let extension = cap. get ( 1 ) . unwrap ( ) . as_str ( ) ;
107
108
108
109
expected_file =
You can’t perform that action at this time.
0 commit comments