Skip to content

Nightly rustdoc warns about code block if it contains comments and tab #48068

Closed
@pravic

Description

A code block inside documentation with rust,no_run directive:

let mut p = String::from("/path");
p.clear();	/* some comment indented with tab */

Nightly compiler throws a warning about it:

Doc-tests hello
WARNING: src\lib.rs - (line 5) Code block is not currently run as a test, but will in future versions of rustdoc. Please ensure this code block is a runnable test, or use the ignore directive.
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

And ignore doesn't help as well though.

Full sample: https://gist.github.com/anonymous/56d5eb5927c50b2a3a22f67723363f45#file-playground-rs-L5-L8

Rust version:

rustc 1.25.0-nightly (bd98fe0 2018-02-06)
binary: rustc
commit-hash: bd98fe0
commit-date: 2018-02-06
host: i686-pc-windows-msvc
release: 1.25.0-nightly
LLVM version: 4.0

Metadata

Labels

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

No branches or pull requests

Issue actions