File tree Expand file tree Collapse file tree 4 files changed +12
-9
lines changed
src/tools/unicode-table-generator/src Expand file tree Collapse file tree 4 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ pub use unicode_data::conversions;
1212pub ( crate ) use unicode_data:: alphabetic:: lookup as Alphabetic ;
1313pub ( crate ) use unicode_data:: grapheme_extend:: lookup as Grapheme_Extend ;
1414pub ( crate ) use unicode_data:: lowercase:: lookup as Lowercase ;
15- pub ( crate ) use unicode_data:: n :: lookup as N ;
15+ pub ( crate ) use unicode_data:: number :: lookup as N ;
1616pub ( crate ) use unicode_data:: uppercase:: lookup as Uppercase ;
1717pub ( crate ) use unicode_data:: white_space:: lookup as White_Space ;
1818
Original file line number Diff line number Diff line change @@ -535,7 +535,7 @@ pub mod lowercase {
535535 }
536536}
537537
538- pub mod n {
538+ pub mod number {
539539 use super :: ShortOffsetRunHeader ;
540540
541541 static SHORT_OFFSET_RUNS : [ ShortOffsetRunHeader ; 43 ] = [
Original file line number Diff line number Diff line change @@ -72,8 +72,9 @@ fn lowercase() {
7272}
7373
7474#[ test]
75+ #[ cfg_attr( miri, ignore) ]
7576fn n ( ) {
76- test_boolean_property ( test_data:: N , unicode_data:: n :: lookup) ;
77+ test_boolean_property ( test_data:: N , unicode_data:: number :: lookup) ;
7778}
7879
7980#[ test]
Original file line number Diff line number Diff line change @@ -242,7 +242,13 @@ fn main() {
242242 emit_codepoints ( & mut emitter, ranges) ;
243243 }
244244
245- modules. push ( ( property. to_lowercase ( ) . to_string ( ) , emitter. file ) ) ;
245+ // FIXME: the generated `unicode_data` is `pub`, so the module names
246+ // can show up in recommendations. While that's a rustc issue, we
247+ // choose a better name for the "N" property to avoid bad diagnostics.
248+ let module_name =
249+ if property == & "N" { "number" . to_string ( ) } else { property. to_lowercase ( ) } ;
250+
251+ modules. push ( ( module_name, emitter. file ) ) ;
246252 writeln ! (
247253 table_file,
248254 "// {:16}: {:5} bytes, {:6} codepoints in {:3} ranges (U+{:06X} - U+{:06X}) using {}" ,
@@ -280,12 +286,8 @@ fn main() {
280286
281287 std:: fs:: write ( & test_path, test_file) . unwrap ( ) ;
282288 std:: fs:: write ( & data_path, table_file) . unwrap ( ) ;
283- rustfmt ( & data_path) ;
284- rustfmt ( & test_path) ;
285- }
286289
287- fn rustfmt ( path : & str ) {
288- std:: process:: Command :: new ( "rustfmt" ) . arg ( path) . status ( ) . expect ( "rustfmt failed" ) ;
290+ eprintln ! ( "Unicode data was generated. Remember to run \" x fmt\" !" ) ;
289291}
290292
291293fn version ( ) -> String {
You can’t perform that action at this time.
0 commit comments