about summary refs log tree commit diff
path: root/compiler/rustc_baked_icu_data
diff options
context:
space:
mode:
authorCharles Lew <crlf0710@gmail.com>2022-11-16 02:37:00 +0800
committerManish Goregaokar <manishsmail@gmail.com>2022-11-18 14:46:36 -0800
commitb22cb90e0a1c228e3705dc546dd9be7da049dd88 (patch)
treeda94ed37b4af681d3dbab6c3563d4004c5a7e64c /compiler/rustc_baked_icu_data
parentb21e0b82c5245bb8329564bc328703bd03536dd2 (diff)
downloadrust-b22cb90e0a1c228e3705dc546dd9be7da049dd88.tar.gz
rust-b22cb90e0a1c228e3705dc546dd9be7da049dd88.zip
Update crate documentation of `rustc_baked_icu_data` crate
Diffstat (limited to 'compiler/rustc_baked_icu_data')
-rw-r--r--compiler/rustc_baked_icu_data/src/lib.rs41
1 files changed, 20 insertions, 21 deletions
diff --git a/compiler/rustc_baked_icu_data/src/lib.rs b/compiler/rustc_baked_icu_data/src/lib.rs
index 2109a7a780b..4651e03f771 100644
--- a/compiler/rustc_baked_icu_data/src/lib.rs
+++ b/compiler/rustc_baked_icu_data/src/lib.rs
@@ -1,28 +1,27 @@
-//! Baked ICU data for eager translation support.
+//! This crate contains pre-baked ICU4X data, generated by `icu4x-datagen`. The tool
+//! fetches locale data from CLDR and transforms them into const code in statics that
+//! ICU4X can load, via databake. `lib.rs` in this crate is manually written, but all
+//! other code is generated.
 //!
+//! This crate can be regenerated when there's a new CLDR version, though that is unlikely
+//! to result in changes in most cases (currently this only covers list formatting data, which
+//! is rather stable). It may need to be regenerated when updating ICU4X versions, especially
+//! across major versions, in case it fails to compile after an update.
+//!
+//! It must be regenerated when adding new locales to Rust, or if Rust's usage of ICU4X
+//! grows to need more kinds of data.
+//!
+//! To regenerate the data, run this command:
+//!
+//! ```text
+//! icu4x-datagen -W --pretty --fingerprint --use-separate-crates \
+//! --format mod -l en es fr it ja pt ru tr zh zh-Hans zh-Hant \
+//! -k list/and@1 fallback/likelysubtags@1 fallback/parents@1 fallback/supplement/co@1 \
+//! --cldr-tag latest --icuexport-tag latest -o src/data
+//! ```
 #![allow(elided_lifetimes_in_paths)]
 
-/* generated with:
-```text
-icu4x-datagen -W --pretty --fingerprint --use-separate-crates --cldr-tag latest --icuexport-tag latest \
---format mod -l en es fr it ja pt ru tr zh zh-Hans zh-Hant -k list/and@1 fallback/likelysubtags@1 fallback/parents@1 fallback/supplement/co@1 \
--o src/data
-```
-*/
-
-// FIXME: Workaround https://github.com/unicode-org/icu4x/issues/2815
 mod data {
-    /*
-    use super::data::BakedDataProvider;
-    use icu_provider::{
-        AnyPayload, AnyProvider, AnyResponse, DataError, DataErrorKind, DataKey, DataRequest,
-        KeyedDataMarker,
-    };
-
-    use crate::data::fallback;
-    use crate::data::list;
-     */
-
     include!("data/mod.rs");
     include!("data/any.rs");
 }