Skip to content

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

Closed
@lcnr

Description

@lcnr
Contributor

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

Activity

added
A-diagnosticsArea: Messages for errors, warnings, and lints
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`
on Mar 30, 2019
added
T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.
and removed
A-diagnosticsArea: Messages for errors, warnings, and lints
A-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.
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
on Mar 30, 2019
added
A-diagnosticsArea: Messages for errors, warnings, and lints
A-suggestion-diagnosticsArea: Suggestions generated by the compiler applied by `cargo fix`
on Mar 30, 2019
added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Mar 30, 2019
euclio

euclio commented on Apr 23, 2019

@euclio
Contributor

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

QuietMisdreavus commented on Apr 24, 2019

@QuietMisdreavus
Member

Oh hey, this looks to be related to #60065 (comment) and #59313, cc @ollie27

added a commit that references this issue on May 2, 2019

Rollup merge of rust-lang#60220 - euclio:rustdoc-test-fatal-parsing-e…

77ecb41
added 2 commits that reference this issue on May 2, 2019

Rollup merge of rust-lang#60220 - euclio:rustdoc-test-fatal-parsing-e…

3010b14

Rollup merge of rust-lang#60220 - euclio:rustdoc-test-fatal-parsing-e…

06e1d88
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Participants

      @Centril@euclio@jonas-schievink@QuietMisdreavus@lcnr

      Issue actions

        doc tests fail without any information when missing back quotes. · Issue #59557 · rust-lang/rust