@@ -107,6 +107,16 @@ const ROOT_PROBLEMATIC_CONSTS: &[u32] = &[
107
107
173390526 ,
108
108
] ;
109
109
110
+ fn generate_problematic_regex (
111
+ consts : & [ u32 ] ,
112
+ letter_digit : & FxHashMap < char , char > ,
113
+ ) -> RegexSet {
114
+ RegexSet :: new (
115
+ generate_problems ( consts, letter_digit)
116
+ . flat_map ( |v| vec ! [ v. to_string( ) , format!( "{:x}" , v) , format!( "{:X}" , v) ] )
117
+ ) . unwrap ( )
118
+ }
119
+
110
120
const INTERNAL_COMPILER_DOCS_LINE : & str = "#### This error code is internal to the compiler and will not be emitted with normal Rust code." ;
111
121
112
122
/// Parser states for `line_is_url`.
@@ -303,16 +313,10 @@ pub fn check(path: &Path, bad: &mut bool) {
303
313
// We only check CSS files in rustdoc.
304
314
path. extension ( ) . map_or ( false , |e| e == "css" ) && !is_in ( path, "src" , "librustdoc" )
305
315
}
306
- let problematic_consts = generate_problems (
316
+ let problematic_regex = generate_problematic_regex (
307
317
ROOT_PROBLEMATIC_CONSTS ,
308
318
& [ ( 'A' , '4' ) , ( 'B' , '8' ) , ( 'E' , '3' ) ] . iter ( ) . cloned ( ) . collect ( ) ,
309
- )
310
- . collect :: < Vec < u32 > > ( ) ;
311
- let problematic_consts_strings: Vec < String > = ( problematic_consts. iter ( ) . map ( u32:: to_string) )
312
- . chain ( problematic_consts. iter ( ) . map ( |v| format ! ( "{:x}" , v) ) )
313
- . chain ( problematic_consts. iter ( ) . map ( |v| format ! ( "{:X}" , v) ) )
314
- . collect ( ) ;
315
- let problematic_regex = RegexSet :: new ( problematic_consts_strings. as_slice ( ) ) . unwrap ( ) ;
319
+ ) ;
316
320
317
321
walk ( path, skip, & mut |entry, contents| {
318
322
let file = entry. path ( ) ;
0 commit comments