rust-lang / rust-lang/rust

Doctest line numbers should be corrected to the failing line, not the start of the test

Open
#142,985 1 comment 0 reactions 1 assignee View on GitHub

@Vrajs16 is already working on this.

Since Jul 9, 2025.

A-doctests C-bug T-rustdoc
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

In the following test failure output, the error is on line 115, not 104. 104 is the start of the example block

running 28 tests
test ratatui-macros/src/lib.rs - (line 104) ... FAILED

...

failures:

---- ratatui-macros/src/lib.rs - (line 104) stdout ----
error: expected one of `,`, `.`, `?`, `]`, or an operator, found `;`
  --> ratatui-macros/src/lib.rs:115:6

...

failures:
    ratatui-macros/src/lib.rs - (line 104)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.