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