Skip to content

Context-less doc error "doc comment contains an invalid Rust code block" in 1.42 #71908

Closed
@rbtcollins

Description

@rbtcollins

I'm getting this warning:

warning: doc comment contains an invalid Rust code block
    |
    = help: mark blocks that do not contain Rust code as text: ```text

from cargo doc --no-deps - thats the entire thing, no file or line information. I think its related to #56884.
Adding -v doesn't help. Nightly produces better diagnostics, but the origin of the error is outside my crate : so thats still somewhat-odd

$ cargo +nightly doc --no-deps
warning: doc comment contains an invalid Rust code block
   --> /home/robertc/.cargo/registry/src/github.com-1ecc6299db9ec823/async-std-1.5.0/src/utils.rs:243:42
    |
243 |         $($head)* extension_trait!(@ext (#[doc = $d]) $($tail)*);
    |                                          ^^^^^^^^^^^
    |
    = help: mark blocks that do not contain Rust code as text: ```text

warning: 1 warning emitted

Meta

rustc --version --verbose:

rustc --version --verbose
rustc 1.42.0 (b8cedc004 2020-03-09)
binary: rustc
commit-hash: b8cedc00407a4c56a3bda1ed605c6fc166655447
commit-date: 2020-03-09
host: x86_64-unknown-linux-gnu
release: 1.42.0
LLVM version: 9.0
rustc 1.45.0-nightly (fa51f810e 2020-04-29)
binary: rustc
commit-hash: fa51f810e5b9254904b92660e7280b7d6a46f112
commit-date: 2020-04-29
host: x86_64-unknown-linux-gnu
release: 1.45.0-nightly
LLVM version: 9.0

This is much better in nightly, but the confusing thing - and the reason I'm filing this bug still is that the reported code is outside my crate.

I'm not even sure where in my crate the origin of the problem is :/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-mcveCall for participation: This issue has a repro, but needs a Minimal Complete and Verifiable ExampleT-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