1
1
#![ cfg_attr( feature = "deny-warnings" , deny( warnings) ) ]
2
+ #![ feature( once_cell) ]
2
3
3
4
use itertools:: Itertools ;
4
- use lazy_static:: lazy_static;
5
5
use regex:: Regex ;
6
6
use std:: collections:: HashMap ;
7
7
use std:: ffi:: OsStr ;
8
8
use std:: fs;
9
+ use std:: lazy:: SyncLazy ;
9
10
use std:: path:: { Path , PathBuf } ;
10
11
use walkdir:: WalkDir ;
11
12
@@ -15,28 +16,31 @@ pub mod ra_setup;
15
16
pub mod stderr_length_check;
16
17
pub mod update_lints;
17
18
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 (
20
21
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
+ "# ,
27
28
)
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 (
30
34
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
+ "# ,
36
40
)
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 ( ) ) ;
40
44
41
45
pub static DOCS_LINK : & str = "https://rust-lang.github.io/rust-clippy/master/index.html" ;
42
46
0 commit comments