@@ -192,6 +192,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
192
192
fn next ( & mut self ) -> Option < Self :: Item > {
193
193
let event = self . inner . next ( ) ;
194
194
let compile_fail;
195
+ let should_panic;
195
196
let ignore;
196
197
let edition;
197
198
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> {
205
206
return Some ( Event :: Start ( Tag :: CodeBlock ( kind) ) ) ;
206
207
}
207
208
compile_fail = parse_result. compile_fail ;
209
+ should_panic = parse_result. should_panic ;
208
210
ignore = parse_result. ignore ;
209
211
edition = parse_result. edition ;
210
212
} else {
@@ -280,6 +282,8 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
280
282
Some ( ( "This example is not tested" . to_owned ( ) , "ignore" ) )
281
283
} else if compile_fail {
282
284
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" ) )
283
287
} else if explicit_edition {
284
288
Some ( ( format ! ( "This code runs with edition {}" , edition) , "edition" ) )
285
289
} else {
@@ -295,6 +299,8 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
295
299
" ignore"
296
300
} else if compile_fail {
297
301
" compile_fail"
302
+ } else if should_panic {
303
+ " should_panic"
298
304
} else if explicit_edition {
299
305
" edition "
300
306
} else {
@@ -314,6 +320,8 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for CodeBlocks<'_, 'a, I> {
314
320
" ignore"
315
321
} else if compile_fail {
316
322
" compile_fail"
323
+ } else if should_panic {
324
+ " should_panic"
317
325
} else if explicit_edition {
318
326
" edition "
319
327
} else {
0 commit comments