@@ -184,7 +184,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'a, I> {
184
184
let ignore;
185
185
let edition;
186
186
if let Some ( Event :: Start ( Tag :: CodeBlock ( lang) ) ) = event {
187
- let parse_result = LangString :: parse ( & lang, self . check_error_codes ) ;
187
+ let parse_result = LangString :: parse ( & lang, self . check_error_codes , false ) ;
188
188
if !parse_result. rust {
189
189
return Some ( Event :: Start ( Tag :: CodeBlock ( lang) ) ) ;
190
190
}
@@ -536,7 +536,8 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for Footnotes<'a, I> {
536
536
}
537
537
}
538
538
539
- pub fn find_testable_code < T : test:: Tester > ( doc : & str , tests : & mut T , error_codes : ErrorCodes ) {
539
+ pub fn find_testable_code < T : test:: Tester > ( doc : & str , tests : & mut T , error_codes : ErrorCodes ,
540
+ enable_per_target_ignores : bool ) {
540
541
let mut parser = Parser :: new ( doc) ;
541
542
let mut prev_offset = 0 ;
542
543
let mut nb_lines = 0 ;
@@ -549,7 +550,7 @@ pub fn find_testable_code<T: test::Tester>(doc: &str, tests: &mut T, error_codes
549
550
let block_info = if s. is_empty ( ) {
550
551
LangString :: all_false ( )
551
552
} else {
552
- LangString :: parse ( & * s, error_codes)
553
+ LangString :: parse ( & * s, error_codes, enable_per_target_ignores )
553
554
} ;
554
555
if !block_info. rust {
555
556
continue ;
@@ -624,7 +625,11 @@ impl LangString {
624
625
}
625
626
}
626
627
627
- fn parse ( string : & str , allow_error_code_check : ErrorCodes ) -> LangString {
628
+ fn parse (
629
+ string : & str ,
630
+ allow_error_code_check : ErrorCodes ,
631
+ enable_per_target_ignores : bool
632
+ ) -> LangString {
628
633
let allow_error_code_check = allow_error_code_check. as_bool ( ) ;
629
634
let mut seen_rust_tags = false ;
630
635
let mut seen_other_tags = false ;
@@ -645,7 +650,7 @@ impl LangString {
645
650
}
646
651
"no_run" => { data. no_run = true ; seen_rust_tags = !seen_other_tags; }
647
652
"ignore" => { data. ignore = Ignore :: All ; seen_rust_tags = !seen_other_tags; }
648
- x if x. starts_with ( "ignore-" ) => {
653
+ x if enable_per_target_ignores && x. starts_with ( "ignore-" ) => {
649
654
ignores. push ( x. trim_start_matches ( "ignore-" ) . to_owned ( ) ) ;
650
655
seen_rust_tags = !seen_other_tags;
651
656
}
@@ -949,7 +954,7 @@ crate fn rust_code_blocks(md: &str) -> Vec<RustCodeBlock> {
949
954
let lang_string = if syntax. is_empty ( ) {
950
955
LangString :: all_false ( )
951
956
} else {
952
- LangString :: parse ( & * syntax, ErrorCodes :: Yes )
957
+ LangString :: parse ( & * syntax, ErrorCodes :: Yes , false )
953
958
} ;
954
959
955
960
if lang_string. rust {
0 commit comments