@@ -136,9 +136,7 @@ impl EarlyProps {
136
136
props. aux_crate . push ( ac) ;
137
137
}
138
138
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 ) ;
142
140
143
141
props. should_fail = props. should_fail || config. parse_name_directive ( ln, "should-fail" ) ;
144
142
} ) ;
@@ -432,9 +430,7 @@ impl TestProps {
432
430
self . compile_flags . push ( format ! ( "--edition={}" , edition) ) ;
433
431
}
434
432
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 ) ;
438
434
439
435
if self . run_flags . is_none ( ) {
440
436
self . run_flags = config. parse_run_flags ( ln) ;
@@ -723,9 +719,16 @@ impl Config {
723
719
self . parse_name_value_directive ( line, "compile-flags" )
724
720
}
725
721
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
+ }
729
732
}
730
733
731
734
fn parse_run_flags ( & self , line : & str ) -> Option < String > {
0 commit comments