File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
src/tools/compiletest/src Expand file tree Collapse file tree 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;
66use std:: path:: { Path , PathBuf } ;
77use std:: process:: Command ;
88
9+ use once_cell:: sync:: Lazy ;
910use regex:: Regex ;
1011use tracing:: * ;
1112
@@ -829,7 +830,8 @@ fn iter_header_extra(
829830 let mut ln = String :: new ( ) ;
830831 let mut line_number = 0 ;
831832
832- let revision_magic_comment = Regex :: new ( "//(\\ [.*\\ ])?~.*" ) . unwrap ( ) ;
833+ static REVISION_MAGIC_COMMENT_RE : Lazy < Regex > =
834+ Lazy :: new ( || Regex :: new ( "//(\\ [.*\\ ])?~.*" ) . unwrap ( ) ) ;
833835
834836 loop {
835837 line_number += 1 ;
@@ -849,7 +851,7 @@ fn iter_header_extra(
849851 // First try to accept `ui_test` style comments
850852 } else if let Some ( ( lncfg, ln) ) = line_directive ( comment, ln) {
851853 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) {
853855 let Some ( ( _, rest) ) = line_directive ( "//" , ln) else {
854856 continue ;
855857 } ;
You can’t perform that action at this time.
0 commit comments