BurntSushi/termcolor

Compile fails on Rust 1.38 and 1.39

taiki-e opened this issue · 1 comments

cfg(doctest) implemented in Rust 1.38 as an unstable feature, and stabilized in Rust 1.40. It compiles fine on Rust 1.37 and older, but fails on Rust 1.38 and 1.39, where this feature existed as an unstable feature.

termcolor/src/lib.rs

Lines 122 to 125 in b052b61

#[cfg(doctest)]
use doc_comment::doctest;
#[cfg(doctest)]
doctest!("../README.md");

Error:

$ cargo +1.39.0 check
    Checking termcolor v1.1.1 (/Users/taiki/projects/termcolor)
error[E0658]: `cfg(doctest)` is experimental and subject to change
   --> src/lib.rs:122:7
    |
122 | #[cfg(doctest)]
    |       ^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/62210

cc #31
Related: rust-lang/regex#685

Filed #36 to fix this.