@@ -192,6 +192,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
192192 fn next ( & mut self ) -> Option < Self :: Item > {
193193 let event = self . inner . next ( ) ;
194194 let compile_fail;
195+ let should_panic;
195196 let ignore;
196197 let edition;
197198 if let Some ( Event :: Start ( Tag :: CodeBlock ( kind) ) ) = event {
@@ -205,6 +206,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
205206 return Some ( Event :: Start ( Tag :: CodeBlock ( kind) ) ) ;
206207 }
207208 compile_fail = parse_result. compile_fail ;
209+ should_panic = parse_result. should_panic ;
208210 ignore = parse_result. ignore ;
209211 edition = parse_result. edition ;
210212 } else {
@@ -280,6 +282,8 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
280282 Some ( ( "This example is not tested" . to_owned ( ) , "ignore" ) )
281283 } else if compile_fail {
282284 Some ( ( "This example deliberately fails to compile" . to_owned ( ) , "compile_fail" ) )
285+ } else if should_panic {
286+ Some ( ( "This example panics" . to_owned ( ) , "should_panic" ) )
283287 } else if explicit_edition {
284288 Some ( ( format ! ( "This code runs with edition {}" , edition) , "edition" ) )
285289 } else {
@@ -295,6 +299,8 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
295299 " ignore"
296300 } else if compile_fail {
297301 " compile_fail"
302+ } else if should_panic {
303+ " should_panic"
298304 } else if explicit_edition {
299305 " edition "
300306 } else {
@@ -314,6 +320,8 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
314320 " ignore"
315321 } else if compile_fail {
316322 " compile_fail"
323+ } else if should_panic {
324+ " should_panic"
317325 } else if explicit_edition {
318326 " edition "
319327 } else {
0 commit comments