Skip to content

Commit ab82fbe

Browse files
committed
fix fallout from RUST-147622
1 parent 86b3a0b commit ab82fbe

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

library/core/src/unicode/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub use unicode_data::conversions;
1212
pub(crate) use unicode_data::alphabetic::lookup as Alphabetic;
1313
pub(crate) use unicode_data::grapheme_extend::lookup as Grapheme_Extend;
1414
pub(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;
1616
pub(crate) use unicode_data::uppercase::lookup as Uppercase;
1717
pub(crate) use unicode_data::white_space::lookup as White_Space;
1818

library/core/src/unicode/unicode_data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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] = [

library/coretests/tests/unicode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ fn lowercase() {
7272
}
7373

7474
#[test]
75+
#[cfg_attr(miri, ignore)]
7576
fn 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]

src/tools/unicode-table-generator/src/main.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff 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

291293
fn version() -> String {

0 commit comments

Comments
 (0)