@@ -469,22 +469,28 @@ impl LangString {
469
469
) ;
470
470
471
471
for token in tokens {
472
- match token {
472
+ match token. trim ( ) {
473
473
"" => { } ,
474
- "should_panic" => { data. should_panic = true ; seen_rust_tags = true ; } ,
475
- "no_run" => { data. no_run = true ; seen_rust_tags = true ; } ,
476
- "ignore" => { data. ignore = true ; seen_rust_tags = true ; } ,
477
- "rust" => { data. rust = true ; seen_rust_tags = true ; } ,
478
- "test_harness" => { data. test_harness = true ; seen_rust_tags = true ; } ,
474
+ "should_panic" => {
475
+ data. should_panic = true ;
476
+ seen_rust_tags = seen_other_tags == false ;
477
+ }
478
+ "no_run" => { data. no_run = true ; seen_rust_tags = !seen_other_tags; }
479
+ "ignore" => { data. ignore = true ; seen_rust_tags = !seen_other_tags; }
480
+ "rust" => { data. rust = true ; seen_rust_tags = true ; }
481
+ "test_harness" => {
482
+ data. test_harness = true ;
483
+ seen_rust_tags = !seen_other_tags || seen_rust_tags;
484
+ }
479
485
"compile_fail" if allow_compile_fail => {
480
486
data. compile_fail = true ;
481
- seen_rust_tags = true ;
487
+ seen_rust_tags = !seen_other_tags || seen_rust_tags ;
482
488
data. no_run = true ;
483
489
}
484
490
x if allow_error_code_check && x. starts_with ( "E" ) && x. len ( ) == 5 => {
485
491
if let Ok ( _) = x[ 1 ..] . parse :: < u32 > ( ) {
486
492
data. error_codes . push ( x. to_owned ( ) ) ;
487
- seen_rust_tags = true ;
493
+ seen_rust_tags = !seen_other_tags || seen_rust_tags ;
488
494
} else {
489
495
seen_other_tags = true ;
490
496
}
@@ -670,9 +676,11 @@ mod tests {
670
676
t ( "test_harness" , false , false , false , true , true , false , Vec :: new ( ) ) ;
671
677
t ( "compile_fail" , false , true , false , true , false , true , Vec :: new ( ) ) ;
672
678
t ( "{.no_run .example}" , false , true , false , true , false , false , Vec :: new ( ) ) ;
673
- t ( "{.sh .should_panic}" , true , false , false , true , false , false , Vec :: new ( ) ) ;
679
+ t ( "{.sh .should_panic}" , true , false , false , false , false , false , Vec :: new ( ) ) ;
674
680
t ( "{.example .rust}" , false , false , false , true , false , false , Vec :: new ( ) ) ;
675
681
t ( "{.test_harness .rust}" , false , false , false , true , true , false , Vec :: new ( ) ) ;
682
+ t ( "text, no_run" , false , true , false , false , false , false , Vec :: new ( ) ) ;
683
+ t ( "text,no_run" , false , true , false , false , false , false , Vec :: new ( ) ) ;
676
684
}
677
685
678
686
#[ test]
0 commit comments