Change:
Doc test with missing closing back quotes fail without any explanation. rust /// let x = 7; /// asserteq!(x, a()); /// // <- HERE /// fn a() -i32 { 7 } rustc 1.35.0-nightly ( 2019-03-22) binary: rustc commit-hash: commit-date: 2019-03-22 host: x8664-unknown-linux-gnu release: 1.35.0-nightly LLVM version: 8.0 rustc 1.33.0 ( 2019-02-28) binary: rustc commit-hash: commit-date: 2019-02-28 host: x86_64-unknown-linux-gnu release: 1.33.0 LLVM version: 8.0
~I believe this is related to . The second <coderust</codeline is unable to be lexed, so the lexer bails with an unbuffered fatal error.~ I was wrong. I have a fix incoming.
Oh hey, this looks to be related to and , cc

Discussion:
compile_fail: bool, mut error_codes: Vec<String>, opts: &TestOptions, maybe_sysroot: Option<PathBuf>, linker: Option<PathBuf>, edition: Edition, persist_doctests: Option<PathBuf>) { <del> // The test harness wants its own `main` and top-level functions, so // never wrap the test in `fn main() { ... }`. let (test, line_offset) = make_test(test, Some(cratename), as_test_harness, opts); </del> <ins> let (test, line_offset) = match panic::catch_unwind(|| { make_test(test, Some(cratename), as_test_harness, opts) }) { Ok((test, line_offset)) => (test, line_offset), Err(cause) if cause.is::<errors::FatalErrorMarker>() => { // If the parser used by `make_test` panicked due to a fatal error, pass the test code // through unchanged. The error will be reported during compilation. (test.to_owned(), 0) }, Err(cause) => panic::resume_unwind(cause), }; </ins> // FIXME(#44940): if doctests ever support path remapping, then this filename // needs to be the result of `SourceMap::span_to_unmapped_path`. let path = match filename {

} } <del> /// Makes the test file. Also returns the number of lines before the code begins </del> <ins> /// Transforms a test into code that can be compiled into a Rust binary, and returns the number of /// lines before the test code begins. /// /// # Panics /// /// This function uses the compiler's parser internally. The parser will panic if it encounters a /// fatal error while parsing the test. </ins> pub fn make_test(s: &str, cratename: Option<&str>, dont_insert_main: bool,

error: aborting due to previous error For more information about this error, try `rustc --explain E0425`. <del> thread '$DIR/failed-doctest-output.rs - OtherStruct (line 17)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:310:13 </del> <ins> thread '$DIR/failed-doctest-output.rs - OtherStruct (line 17)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:319:13 </ins> note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. ---- $DIR/failed-doctest-output.rs - SomeStruct (line 11) stdout ----

thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:3:1 note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. <del> ', src/librustdoc/test.rs:332:17 </del> <ins> ', src/librustdoc/test.rs:341:17 </ins> failures:

<ins> // compile-flags: --test // normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR" // failure-status: 101 // rustc-env: RUST_BACKTRACE=0 /// ```rust /// let x = 7; /// "unterminated /// ``` pub fn foo() {} </ins>

<ins> running 1 test test $DIR/unparseable-doc-test.rs - foo (line 6) ... FAILED failures: ---- $DIR/unparseable-doc-test.rs - foo (line 6) stdout ---- error: unterminated double quote string --> $DIR/unparseable-doc-test.rs:8:1 | 2 | "unterminated | ^^^^^^^^^^^^^ error: aborting due to previous error thread '$DIR/unparseable-doc-test.rs - foo (line 6)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:319:13 note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. failures: $DIR/unparseable-doc-test.rs - foo (line 6) test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out </ins>