Skip to content

Commit

Permalink
tests: remove use of doc_comment crate
Browse files Browse the repository at this point in the history
It relies on `cfg(doctest)`, which wasn't stabilized until Rust 1.43.
Interestingly, it compiled on Rust 1.28, but didn't compile on, e.g.,
Rust 1.39. This breaks our MSRV policy, so we unfortunately remove the
use of doc_comment for now. It's likely possible to conditionally
enable it, but the extra build script required to do version sniffing to
do it doesn't seem worth it.

Fixes rust-lang#684, Fixes rust-lang#685
  • Loading branch information
BurntSushi committed May 29, 2020
1 parent e005346 commit d7fbd15
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
1.3.9 (2020-05-28)
==================
This release fixes a MSRV (Minimum Support Rust Version) regression in the
1.3.8 release. Namely, while 1.3.8 compiles on Rust 1.28, it actually does not
compile on other Rust versions, such as Rust 1.39.

Bug fixes:

* [BUG #685](https://github.com/rust-lang/regex/issue/685):
Remove use of `doc_comment` crate, which cannot be used before Rust 1.43.


1.3.8 (2020-05-28)
==================
This release contains a couple of important bug fixes driven
Expand Down
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ quickcheck = { version = "0.8", default-features = false }
# For generating random test data.
rand = "0.6.5"
# To check README's example
doc-comment = "0.3"
# TODO: Re-enable this once the MSRV is 1.43 or greater.
# See: https://github.com/rust-lang/regex/issues/684
# See: https://github.com/rust-lang/regex/issues/685
# doc-comment = "0.3"

# Run the test suite on the default behavior of Regex::new.
# This includes a mish mash of NFAs and DFAs, which are chosen automatically
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -622,8 +622,8 @@ compile_error!("`std` feature is currently required to build this crate");

#[cfg(feature = "perf-literal")]
extern crate aho_corasick;
#[cfg(doctest)]
extern crate doc_comment;
// #[cfg(doctest)]
// extern crate doc_comment;
#[cfg(feature = "perf-literal")]
extern crate memchr;
#[cfg(test)]
Expand All @@ -633,8 +633,8 @@ extern crate regex_syntax as syntax;
#[cfg(feature = "perf-cache")]
extern crate thread_local;

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

#[cfg(feature = "std")]
pub use error::Error;
Expand Down

0 comments on commit d7fbd15

Please sign in to comment.