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:

regex = "1.5"
   Compiling memchr v2.4.0
error[E0658]: non exhaustive is an experimental feature
   --> /home/cv/.cargo/registry/src/
152 | #[non_exhaustive]
    | ^^^^^^^^^^^^^^^^^
    = note: for more information, see

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.


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


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.