Skip to content

Commit a775004

Browse files
crlf0710Manishearth
authored andcommitted
Migrate diagnostics list output to use icu list formatter.
1 parent 42d3bda commit a775004

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]]
@@ -1707,6 +1707,73 @@ version = "2.0.1"
17071707
source = "registry+https://github.com/rust-lang/crates.io-index"
17081708
checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a"
17091709

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

2104+
[[package]]
2105+
name = "litemap"
2106+
version = "0.6.0"
2107+
source = "registry+https://github.com/rust-lang/crates.io-index"
2108+
checksum = "f34a3f4798fac63fb48cf277eefa38f94d3443baff555bb98e4f56bc9092368e"
2109+
20372110
[[package]]
20382111
name = "lld-wrapper"
20392112
version = "0.1.0"
@@ -2100,7 +2173,7 @@ version = "0.1.0"
21002173
source = "registry+https://github.com/rust-lang/crates.io-index"
21012174
checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558"
21022175
dependencies = [
2103-
"regex-automata",
2176+
"regex-automata 0.1.10",
21042177
]
21052178

21062179
[[package]]
@@ -2927,6 +3000,15 @@ dependencies = [
29273000
"regex-syntax",
29283001
]
29293002

3003+
[[package]]
3004+
name = "regex-automata"
3005+
version = "0.2.0"
3006+
source = "registry+https://github.com/rust-lang/crates.io-index"
3007+
checksum = "e9368763f5a9b804326f3af749e16f9abf378d227bcdee7634b13d8f17793782"
3008+
dependencies = [
3009+
"memchr",
3010+
]
3011+
29303012
[[package]]
29313013
name = "regex-syntax"
29323014
version = "0.6.26"
@@ -3202,6 +3284,16 @@ dependencies = [
32023284
"rustc_span",
32033285
]
32043286

3287+
[[package]]
3288+
name = "rustc_baked_icu_data"
3289+
version = "0.0.0"
3290+
dependencies = [
3291+
"icu_list",
3292+
"icu_locid",
3293+
"icu_provider",
3294+
"litemap",
3295+
]
3296+
32053297
[[package]]
32063298
name = "rustc_borrowck"
32073299
version = "0.0.0"
@@ -3422,13 +3514,18 @@ version = "0.0.0"
34223514
dependencies = [
34233515
"fluent-bundle",
34243516
"fluent-syntax",
3517+
"icu_list",
3518+
"icu_locid",
3519+
"icu_provider_adapters",
34253520
"intl-memoizer",
3521+
"rustc_baked_icu_data",
34263522
"rustc_data_structures",
34273523
"rustc_macros",
34283524
"rustc_serialize",
34293525
"rustc_span",
34303526
"tracing",
34313527
"unic-langid",
3528+
"writeable",
34323529
]
34333530

34343531
[[package]]
@@ -4934,6 +5031,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
49345031
checksum = "f8aeafdfd935e4a7fe16a91ab711fa52d54df84f9c8f7ca5837a9d1d902ef4c2"
49355032
dependencies = [
49365033
"displaydoc",
5034+
"zerovec",
49375035
]
49385036

49395037
[[package]]
@@ -5546,6 +5644,12 @@ version = "0.42.0"
55465644
source = "registry+https://github.com/rust-lang/crates.io-index"
55475645
checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"
55485646

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

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)