Skip to content

doc tests fail without any information when missing back quotes. #59557

Closed
@lcnr

Description

@lcnr

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) ... FAILED

failures:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions