@@ -136,9 +136,7 @@ impl EarlyProps {
136136 props. aux_crate . push ( ac) ;
137137 }
138138
139- if let Some ( r) = config. parse_revisions ( ln) {
140- props. revisions . extend ( r) ;
141- }
139+ config. parse_and_update_revisions ( ln, & mut props. revisions ) ;
142140
143141 props. should_fail = props. should_fail || config. parse_name_directive ( ln, "should-fail" ) ;
144142 } ) ;
@@ -432,9 +430,7 @@ impl TestProps {
432430 self . compile_flags . push ( format ! ( "--edition={}" , edition) ) ;
433431 }
434432
435- if let Some ( r) = config. parse_revisions ( ln) {
436- self . revisions . extend ( r) ;
437- }
433+ config. parse_and_update_revisions ( ln, & mut self . revisions ) ;
438434
439435 if self . run_flags . is_none ( ) {
440436 self . run_flags = config. parse_run_flags ( ln) ;
@@ -723,9 +719,16 @@ impl Config {
723719 self . parse_name_value_directive ( line, "compile-flags" )
724720 }
725721
726- fn parse_revisions ( & self , line : & str ) -> Option < Vec < String > > {
727- self . parse_name_value_directive ( line, "revisions" )
728- . map ( |r| r. split_whitespace ( ) . map ( |t| t. to_string ( ) ) . collect ( ) )
722+ fn parse_and_update_revisions ( & self , line : & str , existing : & mut Vec < String > ) {
723+ if let Some ( raw) = self . parse_name_value_directive ( line, "revisions" ) {
724+ let mut duplicates: HashSet < _ > = existing. iter ( ) . cloned ( ) . collect ( ) ;
725+ for revision in raw. split_whitespace ( ) . map ( |r| r. to_string ( ) ) {
726+ if !duplicates. insert ( revision. clone ( ) ) {
727+ panic ! ( "Duplicate revision: `{}` in line `{}`" , revision, raw) ;
728+ }
729+ existing. push ( revision) ;
730+ }
731+ }
729732 }
730733
731734 fn parse_run_flags ( & self , line : & str ) -> Option < String > {
0 commit comments