Closed
Description
Doc test with missing closing back quotes fail without any explanation.
///```rust
/// let x = 7;
/// assert_eq!(x, a());
/// // <- HERE
///```rust
/// let x = 6;
/// assert_ne!(x, a());
///```
fn a() -> i32 {
7
}
cargo test
:
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
Doc-tests temp
running 1 test
test src/lib.rs - a (line 1) ... FAILEDfailures:
failures:
src/lib.rs - a (line 1)test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
error: test failed, to rerun pass '--doc'
Expected outcome: error while compiling the tests.
tested versions:
rustc --version --verbose
rustc 1.35.0-nightly (cb2f34dc6 2019-03-22)
binary: rustc
commit-hash: cb2f34dc6d7e83d8bcfef79e0388d49f0c24aca7
commit-date: 2019-03-22
host: x86_64-unknown-linux-gnu
release: 1.35.0-nightly
LLVM version: 8.0
rustc 1.33.0 (2aa4c46cf 2019-02-28)
binary: rustc
commit-hash: 2aa4c46cfdd726e97360c2734835aa3515e8c858
commit-date: 2019-02-28
host: x86_64-unknown-linux-gnu
release: 1.33.0
LLVM version: 8.0
Activity
lcnr commentedon Mar 30, 2019
https://play.rust-lang.org/?version=stable&mode=release&edition=2015&gist=6b2de799b02ae7255031b96133d2a697
euclio commentedon Apr 23, 2019
I believe this is related to #56885. The second```rust
line is unable to be lexed, so the lexer bails with an unbuffered fatal error.I was wrong. I have a fix incoming.
QuietMisdreavus commentedon Apr 24, 2019
Oh hey, this looks to be related to #60065 (comment) and #59313, cc @ollie27
Rollup merge of rust-lang#60220 - euclio:rustdoc-test-fatal-parsing-e…
Rollup merge of rust-lang#60220 - euclio:rustdoc-test-fatal-parsing-e…
Rollup merge of rust-lang#60220 - euclio:rustdoc-test-fatal-parsing-e…