File tree 1 file changed +4
-2
lines changed
src/tools/compiletest/src
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use std::io::BufReader;
6
6
use std:: path:: { Path , PathBuf } ;
7
7
use std:: process:: Command ;
8
8
9
+ use once_cell:: sync:: Lazy ;
9
10
use regex:: Regex ;
10
11
use tracing:: * ;
11
12
@@ -829,7 +830,8 @@ fn iter_header_extra(
829
830
let mut ln = String :: new ( ) ;
830
831
let mut line_number = 0 ;
831
832
832
- let revision_magic_comment = Regex :: new ( "//(\\ [.*\\ ])?~.*" ) . unwrap ( ) ;
833
+ static REVISION_MAGIC_COMMENT_RE : Lazy < Regex > =
834
+ Lazy :: new ( || Regex :: new ( "//(\\ [.*\\ ])?~.*" ) . unwrap ( ) ) ;
833
835
834
836
loop {
835
837
line_number += 1 ;
@@ -849,7 +851,7 @@ fn iter_header_extra(
849
851
// First try to accept `ui_test` style comments
850
852
} else if let Some ( ( lncfg, ln) ) = line_directive ( comment, ln) {
851
853
it ( lncfg, orig_ln, ln, line_number) ;
852
- } else if mode == Mode :: Ui && suite == "ui" && !revision_magic_comment . is_match ( ln) {
854
+ } else if mode == Mode :: Ui && suite == "ui" && !REVISION_MAGIC_COMMENT_RE . is_match ( ln) {
853
855
let Some ( ( _, rest) ) = line_directive ( "//" , ln) else {
854
856
continue ;
855
857
} ;
You can’t perform that action at this time.
0 commit comments