Using Regex in Stable Channel

Is it possible to use the Regex crate with stable rust?

When I include it, memchr cannot be compiled because it uses experimental features:

[dependencies]
regex = "1.5"
   Compiling memchr v2.4.0
error[E0658]: non exhaustive is an experimental feature
   --> /home/cv/.cargo/registry/src/github.com-1ecc6299db9ec823/memchr-2.4.0/src/memmem/prefilter/mod.rs:152:1
    |
152 | #[non_exhaustive]
    | ^^^^^^^^^^^^^^^^^
    |
    = note: for more information, see https://github.com/rust-lang/rust/issues/44109

Surely regex exists in stable channel and I'm just doing something very noobish....

That feature is already stable, it looks like it was stabilized back in 2017. You must be using a very old Rust compiler.

5 Likes

Right. The regex crate's minimum supported Rust version is Rust 1.41.1.

This is a good example of the kind of problem that the MSRV RFC would help with. You'd get a more explicit error message saying that your version of Rust is too old instead of an error making it look like the regex crate is using experimental features.

It looks like it's making progress toward stabilization: Tracking issue for RFC 2495, "Minimum Supported Rust Version" · Issue #65262 · rust-lang/rust · GitHub

9 Likes

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.