File tree 1 file changed +16
-9
lines changed
src/tools/compiletest/src
1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -321,16 +321,23 @@ impl TestProps {
321
321
|r| r,
322
322
) ;
323
323
324
- if let Some ( flags) = config. parse_name_value_directive ( ln, COMPILE_FLAGS ) {
325
- self . compile_flags . extend (
326
- flags
327
- . split ( "'" )
328
- . enumerate ( )
329
- . flat_map ( |( i, f) | {
324
+ fn split_flags ( flags : & str ) -> Vec < String > {
325
+ // Individual flags can be single-quoted to preserve spaces; see
326
+ // <https://github.com/rust-lang/rust/pull/115948/commits/957c5db6>.
327
+ flags
328
+ . split ( "'" )
329
+ . enumerate ( )
330
+ . flat_map (
331
+ |( i, f) | {
330
332
if i % 2 == 1 { vec ! [ f] } else { f. split_whitespace ( ) . collect ( ) }
331
- } )
332
- . map ( |s| s. to_owned ( ) ) ,
333
- ) ;
333
+ } ,
334
+ )
335
+ . map ( move |s| s. to_owned ( ) )
336
+ . collect :: < Vec < _ > > ( )
337
+ }
338
+
339
+ if let Some ( flags) = config. parse_name_value_directive ( ln, COMPILE_FLAGS ) {
340
+ self . compile_flags . extend ( split_flags ( & flags) ) ;
334
341
}
335
342
if config. parse_name_value_directive ( ln, INCORRECT_COMPILER_FLAGS ) . is_some ( ) {
336
343
panic ! ( "`compiler-flags` directive should be spelled `compile-flags`" ) ;
You can’t perform that action at this time.
0 commit comments