One approach is to turn regex! into something like lazy_static! but with syntax checking. Since this just reuses Regex::new, I wouldn't call these "compile time regexps."
Another approach is to re-implement everything that has gone into Regex::new, but in a way that works at compile time.
Another approach is to operate more like Ragel and try to get better performance, but this will need to be compensated somehow to provide the full suite of the regex API.
(1) isn't that interesting since lazy_static! and Clippy already serve that role. That latter two approaches require a lot of work that will only be available on nightly for the foreseeable future. (And it's not even clear to me how much faster (3) could even be.)
Another approach is to re-implement everything that has gone into Regex::new, but in a way that works at compile time.
Another approach is to operate more like Ragel and try to get better performance, but this will need to be compensated somehow to provide the full suite of the regex API.
(1) isn't that interesting since lazy_static! and Clippy already serve that role. That latter two approaches require a lot of work that will only be available on nightly for the foreseeable future. (And it's not even clear to me how much faster (3) could even be.)