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

Doctest fail to compile, but there is nothing to test #93662

Closed
piegamesde opened this issue Feb 4, 2022 · 2 comments · Fixed by #93715
Closed

Doctest fail to compile, but there is nothing to test #93662

piegamesde opened this issue Feb 4, 2022 · 2 comments · Fixed by #93715
Assignees
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.

Comments

@piegamesde
Copy link
Contributor

piegamesde commented Feb 4, 2022

When running the doc tests, I get the following error message:

running 2 tests
test src/core.rs - core::Wormhole::send_json (line 269) ... FAILED
test src/core.rs - core::Wormhole::connect_without_code (line 119) ... FAILED

failures:

---- src/core.rs - core::Wormhole::send_json (line 269) stdout ----
error: expected expression, found `}`
 --> src/core.rs:271:1
  |
4 | } _doctest_main_src_core_rs_269_0() }
  | ^ expected expression

error: aborting due to previous error

Couldn't compile the test.
---- src/core.rs - core::Wormhole::connect_without_code (line 119) stdout ----
error: expected expression, found `}`
 --> src/core.rs:121:1
  |
4 | } _doctest_main_src_core_rs_119_0() }
  | ^ expected expression

error: aborting due to previous error

Couldn't compile the test.

failures:
    src/core.rs - core::Wormhole::connect_without_code (line 119)
    src/core.rs - core::Wormhole::send_json (line 269)

test result: FAILED. 0 passed; 2 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s

error: test failed, to rerun pass '--doc'

Source code (not minimized yet). The relevant doc comment looks like this:

    /**
     * Generate a code and connect to the rendezvous server.
     *
     * # Returns <-- this is the line shown in the error message
     *
     * A tuple with a [`WormholeWelcome`] and a [`std::future::Future`] that will
     * do the rest of the client-client handshake and yield the [`Wormhole`] object
     * on success.
     */

Meta

rustc --version --verbose:

rustc 1.60.0-nightly (4e8fb743c 2022-02-03)
binary: rustc
commit-hash: 4e8fb743ccbec27344b2dd42de7057f41d4ebfdd
commit-date: 2022-02-03
host: x86_64-unknown-linux-gnu
release: 1.60.0-nightly
LLVM version: 13.0.0

Some kind soul bisected this onto 5e57faa...777bb86 (between 2022-01-20 and 2022-01-21)

@piegamesde piegamesde added the C-bug Category: This is a bug. label Feb 4, 2022
@GuillaumeGomez GuillaumeGomez added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Feb 5, 2022
@GuillaumeGomez
Copy link
Member

It likely comes from #93038.

@GuillaumeGomez
Copy link
Member

I can be reproduced with both code:

pub mod Wormhole {
    /** # Returns
     *
     */
    pub fn foo() {}
    /**
     * # Returns
     *
     */
    pub fn bar() {}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. 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.

2 participants