diff --git a/src/librustdoc/passes/mod.rs b/src/librustdoc/passes/mod.rs index 2c2bf2b8c0f..5db2d0747c8 100644 --- a/src/librustdoc/passes/mod.rs +++ b/src/librustdoc/passes/mod.rs @@ -178,7 +178,7 @@ impl ConditionalPass { 'outer: for (line_no, md_line) in md_lines.enumerate() { loop { - let source_line = src_lines.next().expect("could not find markdown in source"); + let source_line = src_lines.next()?; match source_line.find(md_line) { Some(offset) => { if line_no == starting_line {