11#![ cfg_attr( feature = "deny-warnings" , deny( warnings) ) ]
2+ #![ feature( once_cell) ]
23
34use itertools:: Itertools ;
4- use lazy_static:: lazy_static;
55use regex:: Regex ;
66use std:: collections:: HashMap ;
77use std:: ffi:: OsStr ;
88use std:: fs;
9+ use std:: lazy:: SyncLazy ;
910use std:: path:: { Path , PathBuf } ;
1011use walkdir:: WalkDir ;
1112
@@ -15,28 +16,31 @@ pub mod ra_setup;
1516pub mod stderr_length_check;
1617pub mod update_lints;
1718
18- lazy_static ! {
19- static ref DEC_CLIPPY_LINT_RE : Regex = Regex :: new(
19+ static DEC_CLIPPY_LINT_RE : SyncLazy < Regex > = SyncLazy :: new ( || {
20+ Regex :: new (
2021 r#"(?x)
21- declare_clippy_lint!\s*[\{(]
22- (?:\s+///.*)*
23- \s+pub\s+(?P<name>[A-Z_][A-Z_0-9]*)\s*,\s*
24- (?P<cat>[a-z_]+)\s*,\s*
25- "(?P<desc>(?:[^"\\]+|\\(?s).(?-s))*)"\s*[})]
26- "#
22+ declare_clippy_lint!\s*[\{(]
23+ (?:\s+///.*)*
24+ \s+pub\s+(?P<name>[A-Z_][A-Z_0-9]*)\s*,\s*
25+ (?P<cat>[a-z_]+)\s*,\s*
26+ "(?P<desc>(?:[^"\\]+|\\(?s).(?-s))*)"\s*[})]
27+ "# ,
2728 )
28- . unwrap( ) ;
29- static ref DEC_DEPRECATED_LINT_RE : Regex = Regex :: new(
29+ . unwrap ( )
30+ } ) ;
31+
32+ static DEC_DEPRECATED_LINT_RE : SyncLazy < Regex > = SyncLazy :: new ( || {
33+ Regex :: new (
3034 r#"(?x)
31- declare_deprecated_lint!\s*[{(]\s*
32- (?:\s+///.*)*
33- \s+pub\s+(?P<name>[A-Z_][A-Z_0-9]*)\s*,\s*
34- "(?P<desc>(?:[^"\\]+|\\(?s).(?-s))*)"\s*[})]
35- "#
35+ declare_deprecated_lint!\s*[{(]\s*
36+ (?:\s+///.*)*
37+ \s+pub\s+(?P<name>[A-Z_][A-Z_0-9]*)\s*,\s*
38+ "(?P<desc>(?:[^"\\]+|\\(?s).(?-s))*)"\s*[})]
39+ "# ,
3640 )
37- . unwrap( ) ;
38- static ref NL_ESCAPE_RE : Regex = Regex :: new ( r#"\\\n\s*"# ) . unwrap ( ) ;
39- }
41+ . unwrap ( )
42+ } ) ;
43+ static NL_ESCAPE_RE : SyncLazy < Regex > = SyncLazy :: new ( || Regex :: new ( r#"\\\n\s*"# ) . unwrap ( ) ) ;
4044
4145pub static DOCS_LINK : & str = "https://rust-lang.github.io/rust-clippy/master/index.html" ;
4246
0 commit comments