Closed
Description
Test case:
// src/lib.rs
/// ```
/// assert!(true);
/// ```
///
/// ```
/// assert!(true);
/// ```
pub fn test() {}
Expected: when running cargo test
, it will run two doctests (as in stable and beta).
running 2 tests
test src/lib.rs - test (line 1) ... ok
test src/lib.rs - test (line 5) ... ok
Actual: Only the first doctest is run, the second one is skipped, with this warning:
WARNING: src/lib.rs - test (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 1 test
test src/lib.rs - test (line 1) ... ok
Real life test case:
- Code: https://github.com/iron/params/blob/8f9db17a4265264327f010fadb6e2231e0e53bde/src/lib.rs#L214-L237
- Doc: https://docs.rs/params/0.6.0/params/struct.Map.html#examples
- Travis: https://travis-ci.org/iron/params/jobs/223656157#L421-L429
(cc @GuillaumeGomez #41290)
No warnings in this version:
rustdoc 1.18.0-nightly (28a742997 2017-04-13)
binary: rustdoc
commit-hash: 28a74299778cdad4ea999e4ee8f8c1ef793338bd
commit-date: 2017-04-13
host: x86_64-apple-darwin
release: 1.18.0-nightly
LLVM version: 3.9
Have warnings in this version:
rustdoc 1.18.0-nightly (9f2abadca 2017-04-18)
binary: rustdoc
commit-hash: 9f2abadca2d065bf81772cb84981d0a22d8e98b3
commit-date: 2017-04-18
host: x86_64-apple-darwin
release: 1.18.0-nightly
LLVM version: 3.9