samedi 11 mars 2017

How do you run doc tests in feature gated implementations?

I noticed that if you have a feature gate like #[feature(cfg = nightly)] around a trait implementation, the doctest is skipped by a call to cargo test, even on a nightly rustc. I tried cargo test --all-features, but the results were the same. (Commenting out the gate results in the tests being run, of course.)

How do you ensure tests on feature gated implementations run?

For reference, here's my working Rust version.

rustc 1.17.0-nightly (c0b7112ba 2017-03-02)
binary: rustc
commit-hash: c0b7112ba246d96f253ba845d91f36c0b7398e42
commit-date: 2017-03-02

Aucun commentaire:

Enregistrer un commentaire