Skip to content

Commit 18a1de2

Browse files
committed
Migrate diagnostics list output to use icu list formatter.
1 parent 422b935 commit 18a1de2

File tree

7 files changed

+296
-28
lines changed

7 files changed

+296
-28
lines changed

Cargo.lock

Lines changed: 174 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
211211
dependencies = [
212212
"lazy_static",
213213
"memchr",
214-
"regex-automata",
214+
"regex-automata 0.1.10",
215215
]
216216

217217
[[package]]
@@ -1710,6 +1710,73 @@ version = "2.0.1"
17101710
source = "registry+https://github.com/rust-lang/crates.io-index"
17111711
checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a"
17121712

1713+
[[package]]
1714+
name = "icu_list"
1715+
version = "1.0.0"
1716+
source = "registry+https://github.com/rust-lang/crates.io-index"
1717+
checksum = "c40218275f081c4493f190357c5395647b06734c2dc3dcb41cc099a0f60168b1"
1718+
dependencies = [
1719+
"displaydoc",
1720+
"icu_locid",
1721+
"icu_provider",
1722+
"regex-automata 0.2.0",
1723+
"writeable",
1724+
"zerovec",
1725+
]
1726+
1727+
[[package]]
1728+
name = "icu_locid"
1729+
version = "1.0.0"
1730+
source = "registry+https://github.com/rust-lang/crates.io-index"
1731+
checksum = "34b3de5d99a0e275fe6193b9586dbf37364daebc0d39c89b5cf8376a53b789e8"
1732+
dependencies = [
1733+
"displaydoc",
1734+
"litemap",
1735+
"tinystr",
1736+
"writeable",
1737+
"zerovec",
1738+
]
1739+
1740+
[[package]]
1741+
name = "icu_provider"
1742+
version = "1.0.1"
1743+
source = "registry+https://github.com/rust-lang/crates.io-index"
1744+
checksum = "2f911086e3c521a8a824d4f8bfd87769645ced2f07ff913b521c0d793be07100"
1745+
dependencies = [
1746+
"displaydoc",
1747+
"icu_locid",
1748+
"icu_provider_macros",
1749+
"stable_deref_trait",
1750+
"writeable",
1751+
"yoke",
1752+
"zerofrom",
1753+
"zerovec",
1754+
]
1755+
1756+
[[package]]
1757+
name = "icu_provider_adapters"
1758+
version = "1.0.0"
1759+
source = "registry+https://github.com/rust-lang/crates.io-index"
1760+
checksum = "980c71d8a91b246ebbb97847178a4b816eea39d1d550c70ee566384555bb6545"
1761+
dependencies = [
1762+
"icu_locid",
1763+
"icu_provider",
1764+
"tinystr",
1765+
"yoke",
1766+
"zerovec",
1767+
]
1768+
1769+
[[package]]
1770+
name = "icu_provider_macros"
1771+
version = "1.0.0"
1772+
source = "registry+https://github.com/rust-lang/crates.io-index"
1773+
checksum = "38cf6f5b65cf81f0b4298da647101acbfe6ae0e25263f92bd7a22597e9d6d606"
1774+
dependencies = [
1775+
"proc-macro2",
1776+
"quote",
1777+
"syn",
1778+
]
1779+
17131780
[[package]]
17141781
name = "idna"
17151782
version = "0.2.0"
@@ -2037,6 +2104,12 @@ dependencies = [
20372104
"walkdir",
20382105
]
20392106

2107+
[[package]]
2108+
name = "litemap"
2109+
version = "0.6.0"
2110+
source = "registry+https://github.com/rust-lang/crates.io-index"
2111+
checksum = "f34a3f4798fac63fb48cf277eefa38f94d3443baff555bb98e4f56bc9092368e"
2112+
20402113
[[package]]
20412114
name = "lld-wrapper"
20422115
version = "0.1.0"
@@ -2103,7 +2176,7 @@ version = "0.1.0"
21032176
source = "registry+https://github.com/rust-lang/crates.io-index"
21042177
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
21052178
dependencies = [
2106-
"regex-automata",
2179+
"regex-automata 0.1.10",
21072180
]
21082181

21092182
[[package]]
@@ -2930,6 +3003,15 @@ dependencies = [
29303003
"regex-syntax",
29313004
]
29323005

3006+
[[package]]
3007+
name = "regex-automata"
3008+
version = "0.2.0"
3009+
source = "registry+https://github.com/rust-lang/crates.io-index"
3010+
checksum = "e9368763f5a9b804326f3af749e16f9abf378d227bcdee7634b13d8f17793782"
3011+
dependencies = [
3012+
"memchr",
3013+
]
3014+
29333015
[[package]]
29343016
name = "regex-syntax"
29353017
version = "0.6.26"
@@ -3204,6 +3286,16 @@ dependencies = [
32043286
"rustc_span",
32053287
]
32063288

3289+
[[package]]
3290+
name = "rustc_baked_icu_data"
3291+
version = "0.0.0"
3292+
dependencies = [
3293+
"icu_list",
3294+
"icu_locid",
3295+
"icu_provider",
3296+
"litemap",
3297+
]
3298+
32073299
[[package]]
32083300
name = "rustc_borrowck"
32093301
version = "0.0.0"
@@ -3424,13 +3516,18 @@ version = "0.0.0"
34243516
dependencies = [
34253517
"fluent-bundle",
34263518
"fluent-syntax",
3519+
"icu_list",
3520+
"icu_locid",
3521+
"icu_provider_adapters",
34273522
"intl-memoizer",
3523+
"rustc_baked_icu_data",
34283524
"rustc_data_structures",
34293525
"rustc_macros",
34303526
"rustc_serialize",
34313527
"rustc_span",
34323528
"tracing",
34333529
"unic-langid",
3530+
"writeable",
34343531
]
34353532

34363533
[[package]]
@@ -4933,6 +5030,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
49335030
checksum = "f8aeafdfd935e4a7fe16a91ab711fa52d54df84f9c8f7ca5837a9d1d902ef4c2"
49345031
dependencies = [
49355032
"displaydoc",
5033+
"zerovec",
49365034
]
49375035

49385036
[[package]]
@@ -5543,6 +5641,12 @@ version = "0.42.0"
55435641
source = "registry+https://github.com/rust-lang/crates.io-index"
55445642
checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
55455643

5644+
[[package]]
5645+
name = "writeable"
5646+
version = "0.5.0"
5647+
source = "registry+https://github.com/rust-lang/crates.io-index"
5648+
checksum = "f8e6ab4f5da1b24daf2c590cfac801bacb27b15b4f050e84eb60149ea726f06b"
5649+
55465650
[[package]]
55475651
name = "xattr"
55485652
version = "0.2.2"
@@ -5595,3 +5699,71 @@ checksum = "fe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1"
55955699
dependencies = [
55965700
"winapi",
55975701
]
5702+
5703+
[[package]]
5704+
name = "yoke"
5705+
version = "0.6.2"
5706+
source = "registry+https://github.com/rust-lang/crates.io-index"
5707+
checksum = "1fe1d55ca72c32d573bfbd5cb2f0ca65a497854c44762957a6d3da96041a5184"
5708+
dependencies = [
5709+
"serde",
5710+
"stable_deref_trait",
5711+
"yoke-derive",
5712+
"zerofrom",
5713+
]
5714+
5715+
[[package]]
5716+
name = "yoke-derive"
5717+
version = "0.6.1"
5718+
source = "registry+https://github.com/rust-lang/crates.io-index"
5719+
checksum = "1346e4cd025ae818b88566eac7eb65ab33a994ea55f355c86889af2e7e56b14e"
5720+
dependencies = [
5721+
"proc-macro2",
5722+
"quote",
5723+
"syn",
5724+
"synstructure",
5725+
]
5726+
5727+
[[package]]
5728+
name = "zerofrom"
5729+
version = "0.1.1"
5730+
source = "registry+https://github.com/rust-lang/crates.io-index"
5731+
checksum = "79e9355fccf72b04b7deaa99ce7a0f6630530acf34045391b74460fcd714de54"
5732+
dependencies = [
5733+
"zerofrom-derive",
5734+
]
5735+
5736+
[[package]]
5737+
name = "zerofrom-derive"
5738+
version = "0.1.1"
5739+
source = "registry+https://github.com/rust-lang/crates.io-index"
5740+
checksum = "2e8aa86add9ddbd2409c1ed01e033cd457d79b1b1229b64922c25095c595e829"
5741+
dependencies = [
5742+
"proc-macro2",
5743+
"quote",
5744+
"syn",
5745+
"synstructure",
5746+
]
5747+
5748+
[[package]]
5749+
name = "zerovec"
5750+
version = "0.9.0"
5751+
source = "registry+https://github.com/rust-lang/crates.io-index"
5752+
checksum = "b9d919a74c17749ccb17beaf6405562e413cd94e98ba52ca1e64bbe7eefbd8b8"
5753+
dependencies = [
5754+
"yoke",
5755+
"zerofrom",
5756+
"zerovec-derive",
5757+
]
5758+
5759+
[[package]]
5760+
name = "zerovec-derive"
5761+
version = "0.9.0"
5762+
source = "registry+https://github.com/rust-lang/crates.io-index"
5763+
checksum = "490e5f878c2856225e884c35927e7ea6db3c24cdb7229b72542c7526ad7ed49e"
5764+
dependencies = [
5765+
"proc-macro2",
5766+
"quote",
5767+
"syn",
5768+
"synstructure",
5769+
]

compiler/rustc_baked_icu_data/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ edition = "2021"
55

66
[dependencies]
77
icu_list = "1.0.0"
8+
icu_locid = "1.0.0"
89
icu_provider = "1.0.1"
910
litemap = "0.6.0"

compiler/rustc_baked_icu_data/src/lib.rs

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,30 @@
22
//!
33
#![allow(elided_lifetimes_in_paths)]
44

5-
// generated with:
6-
// ```text
7-
// icu4x-datagen -W --pretty --fingerprint --use-separate-crates --cldr-tag latest --icuexport-tag latest \
8-
// --format mod -l en es fr it ja pt ru tr zh-Hans zh-Hant -k list/and@1 -o src/data
9-
// ```
5+
/* generated with:
6+
```text
7+
icu4x-datagen -W --pretty --fingerprint --use-separate-crates --cldr-tag latest --icuexport-tag latest \
8+
--format mod -l en es fr it ja pt ru tr zh-Hans zh-Hant -k list/and@1 -o src/data
9+
```
10+
*/
1011

1112
mod data;
1213

1314
pub use data::BakedDataProvider;
1415

15-
pub fn baked_data_provider() -> BakedDataProvider {
16+
pub const fn baked_data_provider() -> BakedDataProvider {
1617
data::BakedDataProvider
1718
}
19+
20+
pub mod supported_locales {
21+
pub const EN: icu_locid::Locale = icu_locid::locale!("en");
22+
pub const ES: icu_locid::Locale = icu_locid::locale!("es");
23+
pub const FR: icu_locid::Locale = icu_locid::locale!("fr");
24+
pub const IT: icu_locid::Locale = icu_locid::locale!("it");
25+
pub const JA: icu_locid::Locale = icu_locid::locale!("ja");
26+
pub const PT: icu_locid::Locale = icu_locid::locale!("pt");
27+
pub const RU: icu_locid::Locale = icu_locid::locale!("ru");
28+
pub const TR: icu_locid::Locale = icu_locid::locale!("tr");
29+
pub const ZH_HANS: icu_locid::Locale = icu_locid::locale!("zh-Hans");
30+
pub const ZH_HANT: icu_locid::Locale = icu_locid::locale!("zh-Hant");
31+
}

compiler/rustc_error_messages/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,14 @@ edition = "2021"
99
fluent-bundle = "0.15.2"
1010
fluent-syntax = "0.11"
1111
intl-memoizer = "0.5.1"
12+
rustc_baked_icu_data = { path = "../rustc_baked_icu_data" }
1213
rustc_data_structures = { path = "../rustc_data_structures" }
1314
rustc_serialize = { path = "../rustc_serialize" }
1415
rustc_span = { path = "../rustc_span" }
1516
rustc_macros = { path = "../rustc_macros" }
1617
tracing = "0.1"
1718
unic-langid = { version = "0.9.0", features = ["macros"] }
19+
icu_list = "1.0.0"
20+
writeable = "0.5.0"
21+
icu_locid = "1.0.0"
22+
icu_provider_adapters = "1.0.0"

0 commit comments

Comments
 (0)