steveklabnik / rustdoc

Not a real thing, see https://github.com/rust-lang/rust for rustdoc's actual source code
https://github.com/rust-lang/rust
104 stars 22 forks source link

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

Closed pravic closed 6 years ago

pravic commented 6 years ago

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 (bd98fe0c0 2018-02-06) binary: rustc commit-hash: bd98fe0c05601d8a318a709adc4263f3348ea8d4 commit-date: 2018-02-06 host: i686-pc-windows-msvc release: 1.25.0-nightly LLVM version: 4.0

steveklabnik commented 6 years ago

Please file this against rust-lang/rust, this is for the new iteration of rustdoc, which doesn't have test support yet.