@@ -184,7 +184,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'a, I> {
184184 let ignore;
185185 let edition;
186186 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 ) ;
188188 if !parse_result. rust {
189189 return Some ( Event :: Start ( Tag :: CodeBlock ( lang) ) ) ;
190190 }
@@ -536,7 +536,8 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for Footnotes<'a, I> {
536536 }
537537}
538538
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 ) {
540541 let mut parser = Parser :: new ( doc) ;
541542 let mut prev_offset = 0 ;
542543 let mut nb_lines = 0 ;
@@ -549,7 +550,7 @@ pub fn find_testable_code<T: test::Tester>(doc: &str, tests: &mut T, error_codes
549550 let block_info = if s. is_empty ( ) {
550551 LangString :: all_false ( )
551552 } else {
552- LangString :: parse ( & * s, error_codes)
553+ LangString :: parse ( & * s, error_codes, enable_per_target_ignores )
553554 } ;
554555 if !block_info. rust {
555556 continue ;
@@ -624,7 +625,11 @@ impl LangString {
624625 }
625626 }
626627
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 {
628633 let allow_error_code_check = allow_error_code_check. as_bool ( ) ;
629634 let mut seen_rust_tags = false ;
630635 let mut seen_other_tags = false ;
@@ -645,7 +650,7 @@ impl LangString {
645650 }
646651 "no_run" => { data. no_run = true ; seen_rust_tags = !seen_other_tags; }
647652 "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-" ) => {
649654 ignores. push ( x. trim_start_matches ( "ignore-" ) . to_owned ( ) ) ;
650655 seen_rust_tags = !seen_other_tags;
651656 }
@@ -949,7 +954,7 @@ crate fn rust_code_blocks(md: &str) -> Vec<RustCodeBlock> {
949954 let lang_string = if syntax. is_empty ( ) {
950955 LangString :: all_false ( )
951956 } else {
952- LangString :: parse ( & * syntax, ErrorCodes :: Yes )
957+ LangString :: parse ( & * syntax, ErrorCodes :: Yes , false )
953958 } ;
954959
955960 if lang_string. rust {
0 commit comments