Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lcnr opened this issue Mar 30, 2019 · 3 comments · Fixed by #60220
Closed

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

lcnr opened this issue Mar 30, 2019 · 3 comments · Fixed by #60220
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@lcnr
Copy link
Contributor

lcnr commented Mar 30, 2019

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
@lcnr
Copy link
Contributor Author

lcnr commented Mar 30, 2019

@Centril Centril added A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. labels Mar 30, 2019
@jonas-schievink jonas-schievink added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. and removed A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools labels Mar 30, 2019
@Centril Centril added A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. labels Mar 30, 2019
@jonas-schievink jonas-schievink added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 30, 2019
@euclio
Copy link
Contributor

euclio commented 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
Copy link
Member

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

kennytm added a commit to kennytm/rust that referenced this issue May 2, 2019
…rrors, r=QuietMisdreavus

report fatal errors during doctest parsing

Fixes rust-lang#59557.
Centril added a commit to Centril/rust that referenced this issue May 2, 2019
…rrors, r=QuietMisdreavus

report fatal errors during doctest parsing

Fixes rust-lang#59557.
Centril added a commit to Centril/rust that referenced this issue May 3, 2019
…rrors, r=QuietMisdreavus

report fatal errors during doctest parsing

Fixes rust-lang#59557.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-suggestion-diagnostics Area: Suggestions generated by the compiler applied by `cargo fix`. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants