@@ -93,7 +93,7 @@ static PROPERTIES: &[&str] = &[
9393 "Case_Ignorable" ,
9494 "Grapheme_Extend" ,
9595 "White_Space" ,
96- "N " ,
96+ "Numeric " ,
9797] ;
9898
9999struct UnicodeData {
@@ -148,10 +148,13 @@ fn load_data() -> UnicodeData {
148148 for row in ucd_parse:: UnicodeDataExpander :: new (
149149 ucd_parse:: parse :: < _ , ucd_parse:: UnicodeData > ( & UNICODE_DIRECTORY ) . unwrap ( ) ,
150150 ) {
151- let general_category = if [ "Nd" , "Nl" , "No" ] . contains ( & row. general_category . as_str ( ) ) {
152- "N"
153- } else {
154- row. general_category . as_str ( )
151+ // FIXME: this used to map `Nd`, `Nl` and `No` to `N`, but the generated
152+ // `unicode_data` is `pub`, so the module names can show up in
153+ // recommendations (see issue #148387). While that's a rustc issue, we
154+ // choose a better name for the `N` property to avoid bad diagnostics.
155+ let general_category = match row. general_category . as_str ( ) {
156+ "Nd" | "Nl" | "No" => "Numeric" ,
157+ category => category,
155158 } ;
156159 if let Some ( name) = PROPERTIES . iter ( ) . find ( |prop| * * prop == general_category) {
157160 properties
@@ -241,7 +244,9 @@ fn main() {
241244 emit_codepoints ( & mut emitter, ranges) ;
242245 }
243246
244- modules. push ( ( property. to_lowercase ( ) . to_string ( ) , emitter. file ) ) ;
247+ let module_name = property. to_lowercase ( ) ;
248+
249+ modules. push ( ( module_name, emitter. file ) ) ;
245250 writeln ! (
246251 table_file,
247252 "// {:16}: {:5} bytes, {:6} codepoints in {:3} ranges (U+{:06X} - U+{:06X}) using {}" ,
0 commit comments