From 2e14d7f6a0ede52db1be4bd1818c433c71284083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adolfo=20Ochagav=C3=ADa?= Date: Mon, 24 Nov 2014 10:39:50 +0100 Subject: [PATCH] Make regex! generate a constant Regex Fixes https://github.com/rust-lang/rust/issues/18427 --- src/libregex_macros/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libregex_macros/lib.rs b/src/libregex_macros/lib.rs index 3cc6d361e3c58..0694545585766 100644 --- a/src/libregex_macros/lib.rs +++ b/src/libregex_macros/lib.rs @@ -148,7 +148,7 @@ impl<'a> NfaGen<'a> { // the user is only warned about *their* unused variable/code, and not the // unused code generated by regex!. See #14185 for an example. #[allow(dead_code)] -static CAP_NAMES: &'static [Option<&'static str>] = &$cap_names; +const CAP_NAMES: &'static [Option<&'static str>] = &$cap_names; #[allow(dead_code)] fn exec<'t>(which: ::regex::native::MatchKind, input: &'t str,