This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-9
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 1 file changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -321,16 +321,23 @@ impl TestProps {
321321 |r| r,
322322 ) ;
323323
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) | {
330332 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) ) ;
334341 }
335342 if config. parse_name_value_directive ( ln, INCORRECT_COMPILER_FLAGS ) . is_some ( ) {
336343 panic ! ( "`compiler-flags` directive should be spelled `compile-flags`" ) ;
You can’t perform that action at this time.
0 commit comments