summaryrefslogtreecommitdiffstats
path: root/vendor/icu_provider_adapters
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/icu_provider_adapters
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/icu_provider_adapters')
-rw-r--r--vendor/icu_provider_adapters/.cargo-checksum.json2
-rw-r--r--vendor/icu_provider_adapters/Cargo.toml13
-rw-r--r--vendor/icu_provider_adapters/src/any_payload.rs11
-rw-r--r--vendor/icu_provider_adapters/src/either.rs1
-rw-r--r--vendor/icu_provider_adapters/src/empty.rs1
-rw-r--r--vendor/icu_provider_adapters/src/fallback/adapter.rs17
-rw-r--r--vendor/icu_provider_adapters/src/fallback/mod.rs2
-rw-r--r--vendor/icu_provider_adapters/src/filter/impls.rs11
-rw-r--r--vendor/icu_provider_adapters/src/filter/mod.rs1
-rw-r--r--vendor/icu_provider_adapters/src/fork/by_error.rs1
-rw-r--r--vendor/icu_provider_adapters/src/helpers.rs2
-rw-r--r--vendor/icu_provider_adapters/src/lib.rs2
12 files changed, 38 insertions, 26 deletions
diff --git a/vendor/icu_provider_adapters/.cargo-checksum.json b/vendor/icu_provider_adapters/.cargo-checksum.json
index 292541e8f..7b2a6906a 100644
--- a/vendor/icu_provider_adapters/.cargo-checksum.json
+++ b/vendor/icu_provider_adapters/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"Cargo.toml":"2546ca7ab46e2bd189ae3821948d10fdd46634138784d8b3c373c90ae9b1fe27","LICENSE":"4ad7541d66a407234e2c84902124cef325c29f3e966353efdb800bedb8b8da21","README.md":"e6a08c2bc307b66c93de20c2c366da896f7fd3f5e5eb402edd2eeba79476b600","src/any_payload.rs":"55336b0a861be2da125a411924a3597de5593135c8ff589420237189b77311f8","src/either.rs":"aa309c26deafcb9470bb9eb15e629fc53f2fb5d7e412d1a2317bc170f0652588","src/empty.rs":"3b55431437af04aaed5dcfc524d42c51a35bb7213274327cb1df70cb69d5a5c5","src/fallback/adapter.rs":"2e51f50215e9020f2e84a926227054e61fc001f44170bf27e1366c66097f2c83","src/fallback/algorithms.rs":"9409ad6f6f617d4433b9f6b303d131782877a0a10470533e3864b97355b9a3f1","src/fallback/mod.rs":"b2aa936b64ac0498c815683d5f3d151154fca9f962f56b172fd2582ff4b639ae","src/fallback/provider.rs":"ef8a835e3ed2b7871b6f6e78ae2e73575b26adc9e8e0b5a7170c8513e7fe3269","src/filter/impls.rs":"58fcc1f03454769a3c11a92cb4b7b9f7833a0c042ea80b4e863609e2414eed0f","src/filter/mod.rs":"960e1c22d7d2323bf73c3ff6ea2d34158ff767f2a6b4fc8c40e982bf8c2dd500","src/fork/by_error.rs":"4f89ba3b019f6ab36784577a664fece042ad2318026038cecb23c6f62fc63aa0","src/fork/macros.rs":"5aebb0134923fa9fa0fe7c16d2d85a1a29cf4ea49505187db56bf0bc8e984ad0","src/fork/mod.rs":"7378895128bf1ccc9de7f5675668ef922d3df7b84b04f68af4d5b49efe60341e","src/fork/predicates.rs":"314bf33144c6827cd3df05877d7c20fb64c9b18f6230e229340b8f04f4ccf4d3","src/helpers.rs":"008af3aa36ebf43ec249dd9162ff36c150fa00fe78b3065b023d59acbe218b7b","src/lib.rs":"7499b4bcb40453bc4678d6ae3febf05f5c1e351120513ddd694983e6da56f268","tests/data/langtest/de/core/helloworld@1/de.json":"5a45b1d80567de8c4ff754f7dbe20c22477c1e00a9400b38397eb034f295b8f8","tests/data/langtest/de/manifest.json":"fa2f848cff051fd12a909389fbbc44b93ae1feb92cce466cc4381f9548443ea9","tests/data/langtest/ro/core/helloworld@1/ro.json":"b6b68292746dd6bb2d92d9c08e2753db556ec9c954a3b593b0b8999df550f298","tests/data/langtest/ro/manifest.json":"fa2f848cff051fd12a909389fbbc44b93ae1feb92cce466cc4381f9548443ea9"},"package":"8e89bf33962b24bb48a4a21330c20c9ff17949338ea376360dd9eda2c209dca1"} \ No newline at end of file
+{"files":{"Cargo.toml":"bc35c9045058859105d040996e5f8f204a2337b832f1a23cf6f1d10fb1eb45ee","LICENSE":"4ad7541d66a407234e2c84902124cef325c29f3e966353efdb800bedb8b8da21","README.md":"e6a08c2bc307b66c93de20c2c366da896f7fd3f5e5eb402edd2eeba79476b600","src/any_payload.rs":"165d41d018a611a7ef25dab621bbd408e6ba22dde58365817944898de138be3e","src/either.rs":"02e646af7aa6d8af1a03e448bedb2498b026d418de8340a5be52b1d366ad9b6c","src/empty.rs":"1503b2f73b2a727a9e502ab7081da3261df470bc86b762ab5748c31fad8cfbc6","src/fallback/adapter.rs":"55188c9acb6ddc852b9218b14c97304e0378f9e40eedb0f0af41b5036a78e54f","src/fallback/algorithms.rs":"9409ad6f6f617d4433b9f6b303d131782877a0a10470533e3864b97355b9a3f1","src/fallback/mod.rs":"9a1ba8dcba21dbcb5acc4a019d640fffcfd2efd043bfa42a5690a9de593479d1","src/fallback/provider.rs":"ef8a835e3ed2b7871b6f6e78ae2e73575b26adc9e8e0b5a7170c8513e7fe3269","src/filter/impls.rs":"588918fdcadda3572844352bf22419910ee6430f3e5a6e7c5e012120ad2eb932","src/filter/mod.rs":"33a622b9684c5e445b2af8aec9cd3ba5dfe3b51d917dd2776b267657e6a5b72d","src/fork/by_error.rs":"450a24bfaa17e32899e4ba4286623b2b3b36af81fb5abd9b1e28a2af18c3b9dc","src/fork/macros.rs":"5aebb0134923fa9fa0fe7c16d2d85a1a29cf4ea49505187db56bf0bc8e984ad0","src/fork/mod.rs":"7378895128bf1ccc9de7f5675668ef922d3df7b84b04f68af4d5b49efe60341e","src/fork/predicates.rs":"314bf33144c6827cd3df05877d7c20fb64c9b18f6230e229340b8f04f4ccf4d3","src/helpers.rs":"0e5c8424c9e51956cd065d4ecf4f478bbc3978888b4bbb012ad3f5d6a7062fb1","src/lib.rs":"243ec29c6e5fbe59004f5774f1b252166b06a264e218a7209fe6ed83c25dd03a","tests/data/langtest/de/core/helloworld@1/de.json":"5a45b1d80567de8c4ff754f7dbe20c22477c1e00a9400b38397eb034f295b8f8","tests/data/langtest/de/manifest.json":"fa2f848cff051fd12a909389fbbc44b93ae1feb92cce466cc4381f9548443ea9","tests/data/langtest/ro/core/helloworld@1/ro.json":"b6b68292746dd6bb2d92d9c08e2753db556ec9c954a3b593b0b8999df550f298","tests/data/langtest/ro/manifest.json":"fa2f848cff051fd12a909389fbbc44b93ae1feb92cce466cc4381f9548443ea9"},"package":"f4ae1e2bd0c41728b77e7c46e9afdec5e2127d1eedacc684724667d50c126bd3"} \ No newline at end of file
diff --git a/vendor/icu_provider_adapters/Cargo.toml b/vendor/icu_provider_adapters/Cargo.toml
index 6de64fe8b..291a17ffc 100644
--- a/vendor/icu_provider_adapters/Cargo.toml
+++ b/vendor/icu_provider_adapters/Cargo.toml
@@ -10,9 +10,9 @@
# See Cargo.toml.orig for the original contents.
[package]
-edition = "2018"
+edition = "2021"
name = "icu_provider_adapters"
-version = "1.1.0"
+version = "1.2.0"
authors = ["The ICU4X Project Developers"]
include = [
"src/**/*",
@@ -28,7 +28,6 @@ readme = "README.md"
categories = ["internationalization"]
license = "Unicode-DFS-2016"
repository = "https://github.com/unicode-org/icu4x"
-resolver = "2"
[dependencies.databake]
version = "0.1.3"
@@ -36,11 +35,11 @@ features = ["derive"]
optional = true
[dependencies.icu_locid]
-version = "1.1.0"
+version = "1.2.0"
features = ["zerovec"]
[dependencies.icu_provider]
-version = "1.1.0"
+version = "1.2.0"
features = ["macros"]
[dependencies.serde]
@@ -57,10 +56,10 @@ version = "0.7.1"
features = ["zerovec"]
[dependencies.yoke]
-version = "0.7.0"
+version = "0.7.1"
[dependencies.zerovec]
-version = "0.9.2"
+version = "0.9.4"
features = ["yoke"]
[dev-dependencies]
diff --git a/vendor/icu_provider_adapters/src/any_payload.rs b/vendor/icu_provider_adapters/src/any_payload.rs
index bbb9220c3..3179a1de8 100644
--- a/vendor/icu_provider_adapters/src/any_payload.rs
+++ b/vendor/icu_provider_adapters/src/any_payload.rs
@@ -45,6 +45,7 @@ use zerofrom::ZeroFrom;
/// })
/// ))
/// ```
+#[derive(Debug)]
#[allow(clippy::exhaustive_structs)] // this type is stable
pub struct AnyPayloadProvider {
/// The [`DataKey`] for which to provide data. All others will receive a
@@ -56,7 +57,7 @@ pub struct AnyPayloadProvider {
impl AnyPayloadProvider {
/// Creates an `AnyPayloadProvider` with an owned (allocated) payload of the given data.
- pub fn from_owned<M: KeyedDataMarker + 'static>(data: M::Yokeable) -> Self
+ pub fn from_owned<M: KeyedDataMarker>(data: M::Yokeable) -> Self
where
M::Yokeable: icu_provider::MaybeSendSync,
{
@@ -72,7 +73,7 @@ impl AnyPayloadProvider {
}
/// Creates an `AnyPayloadProvider` from an existing [`DataPayload`].
- pub fn from_payload<M: KeyedDataMarker + 'static>(payload: DataPayload<M>) -> Self
+ pub fn from_payload<M: KeyedDataMarker>(payload: DataPayload<M>) -> Self
where
M::Yokeable: icu_provider::MaybeSendSync,
{
@@ -83,7 +84,7 @@ impl AnyPayloadProvider {
}
/// Creates an `AnyPayloadProvider` from an existing [`AnyPayload`].
- pub fn from_any_payload<M: KeyedDataMarker + 'static>(payload: AnyPayload) -> Self {
+ pub fn from_any_payload<M: KeyedDataMarker>(payload: AnyPayload) -> Self {
AnyPayloadProvider {
key: M::KEY,
data: payload,
@@ -91,7 +92,7 @@ impl AnyPayloadProvider {
}
/// Creates an `AnyPayloadProvider` with the default (allocated) version of the data struct.
- pub fn new_default<M: KeyedDataMarker + 'static>() -> Self
+ pub fn new_default<M: KeyedDataMarker>() -> Self
where
M::Yokeable: Default,
M::Yokeable: icu_provider::MaybeSendSync,
@@ -112,7 +113,7 @@ impl AnyProvider for AnyPayloadProvider {
impl<M> DataProvider<M> for AnyPayloadProvider
where
- M: KeyedDataMarker + 'static,
+ M: KeyedDataMarker,
for<'a> YokeTraitHack<<M::Yokeable as Yokeable<'a>>::Output>: Clone,
M::Yokeable: ZeroFrom<'static, M::Yokeable>,
M::Yokeable: icu_provider::MaybeSendSync,
diff --git a/vendor/icu_provider_adapters/src/either.rs b/vendor/icu_provider_adapters/src/either.rs
index b62a9c3fb..5927795ef 100644
--- a/vendor/icu_provider_adapters/src/either.rs
+++ b/vendor/icu_provider_adapters/src/either.rs
@@ -14,6 +14,7 @@ use icu_provider::datagen;
/// Data provider traits implemented by both `P0` and `P1` are implemented on
/// `EitherProvider<P0, P1>`.
#[allow(clippy::exhaustive_enums)] // this is stable
+#[derive(Debug)]
pub enum EitherProvider<P0, P1> {
/// A value of type `P0`.
A(P0),
diff --git a/vendor/icu_provider_adapters/src/empty.rs b/vendor/icu_provider_adapters/src/empty.rs
index 85c6b9bc1..e8592bc25 100644
--- a/vendor/icu_provider_adapters/src/empty.rs
+++ b/vendor/icu_provider_adapters/src/empty.rs
@@ -29,6 +29,7 @@ use icu_provider::prelude::*;
/// })
/// ));
/// ```
+#[derive(Debug)]
pub struct EmptyDataProvider {
error_kind: DataErrorKind,
}
diff --git a/vendor/icu_provider_adapters/src/fallback/adapter.rs b/vendor/icu_provider_adapters/src/fallback/adapter.rs
index f7cc10fe6..8d9d79f2d 100644
--- a/vendor/icu_provider_adapters/src/fallback/adapter.rs
+++ b/vendor/icu_provider_adapters/src/fallback/adapter.rs
@@ -3,7 +3,7 @@
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).
use super::*;
-use crate::helpers::result_is_err_missing_data_options;
+use crate::helpers::result_is_err_missing_locale;
/// A data provider wrapper that performs locale fallback. This enables arbitrary locales to be
/// handled at runtime.
@@ -43,7 +43,7 @@ use crate::helpers::result_is_err_missing_data_options;
/// "こんにちは世界",
/// );
/// ```
-#[derive(Clone)]
+#[derive(Clone, Debug)]
pub struct LocaleFallbackProvider<P> {
inner: P,
fallbacker: LocaleFallbacker,
@@ -182,7 +182,7 @@ impl<P> LocaleFallbackProvider<P> {
fn run_fallback<F1, F2, R>(
&self,
key: DataKey,
- base_req: DataRequest,
+ mut base_req: DataRequest,
mut f1: F1,
mut f2: F2,
) -> Result<R, DataError>
@@ -192,19 +192,23 @@ impl<P> LocaleFallbackProvider<P> {
{
let key_fallbacker = self.fallbacker.for_key(key);
let mut fallback_iterator = key_fallbacker.fallback_for(base_req.locale.clone());
+ let base_silent = core::mem::replace(&mut base_req.metadata.silent, true);
loop {
let result = f1(DataRequest {
locale: fallback_iterator.get(),
- metadata: Default::default(),
+ metadata: base_req.metadata,
});
- if !result_is_err_missing_data_options(&result) {
+ if !result_is_err_missing_locale(&result) {
return result
.map(|mut res| {
f2(&mut res).locale = Some(fallback_iterator.take());
res
})
// Log the original request rather than the fallback request
- .map_err(|e| e.with_req(key, base_req));
+ .map_err(|e| {
+ base_req.metadata.silent = base_silent;
+ e.with_req(key, base_req)
+ });
}
// If we just checked und, break out of the loop.
if fallback_iterator.get().is_empty() {
@@ -212,6 +216,7 @@ impl<P> LocaleFallbackProvider<P> {
}
fallback_iterator.step();
}
+ base_req.metadata.silent = base_silent;
Err(DataErrorKind::MissingLocale.with_req(key, base_req))
}
}
diff --git a/vendor/icu_provider_adapters/src/fallback/mod.rs b/vendor/icu_provider_adapters/src/fallback/mod.rs
index 81adad41c..a28620b25 100644
--- a/vendor/icu_provider_adapters/src/fallback/mod.rs
+++ b/vendor/icu_provider_adapters/src/fallback/mod.rs
@@ -241,6 +241,7 @@ pub struct LocaleFallbackerWithConfig<'a> {
}
/// Inner iteration type. Does not own the item under fallback.
+#[derive(Debug)]
struct LocaleFallbackIteratorInner<'a, 'b> {
likely_subtags: &'a LocaleFallbackLikelySubtagsV1<'a>,
parents: &'a LocaleFallbackParentsV1<'a>,
@@ -255,6 +256,7 @@ struct LocaleFallbackIteratorInner<'a, 'b> {
///
/// Because the `Iterator` trait does not allow items to borrow from the iterator, this class does
/// not implement that trait. Instead, use `.step()` and `.get()`.
+#[derive(Debug)]
pub struct LocaleFallbackIterator<'a, 'b> {
current: DataLocale,
inner: LocaleFallbackIteratorInner<'a, 'b>,
diff --git a/vendor/icu_provider_adapters/src/filter/impls.rs b/vendor/icu_provider_adapters/src/filter/impls.rs
index af8ea7adf..df18cf72c 100644
--- a/vendor/icu_provider_adapters/src/filter/impls.rs
+++ b/vendor/icu_provider_adapters/src/filter/impls.rs
@@ -8,6 +8,9 @@ use icu_provider::prelude::*;
use icu_locid::LanguageIdentifier;
+type RequestFilterDataProviderOutput<'a, D> =
+ RequestFilterDataProvider<D, Box<dyn Fn(DataRequest) -> bool + Sync + 'a>>;
+
impl<D, F> RequestFilterDataProvider<D, F>
where
F: Fn(DataRequest) -> bool + Sync,
@@ -69,7 +72,7 @@ where
pub fn filter_by_langid<'a>(
self,
predicate: impl Fn(&LanguageIdentifier) -> bool + Sync + 'a,
- ) -> RequestFilterDataProvider<D, Box<dyn Fn(DataRequest) -> bool + Sync + 'a>>
+ ) -> RequestFilterDataProviderOutput<'a, D>
where
F: 'a,
{
@@ -139,7 +142,7 @@ where
pub fn filter_by_langid_allowlist_strict<'a>(
self,
allowlist: &'a [LanguageIdentifier],
- ) -> RequestFilterDataProvider<D, Box<dyn Fn(DataRequest) -> bool + Sync + 'a>>
+ ) -> RequestFilterDataProviderOutput<'a, D>
where
F: 'a,
{
@@ -194,9 +197,7 @@ where
/// })
/// ));
/// ```
- pub fn require_langid<'a>(
- self,
- ) -> RequestFilterDataProvider<D, Box<dyn Fn(DataRequest) -> bool + Sync + 'a>>
+ pub fn require_langid<'a>(self) -> RequestFilterDataProviderOutput<'a, D>
where
F: 'a,
{
diff --git a/vendor/icu_provider_adapters/src/filter/mod.rs b/vendor/icu_provider_adapters/src/filter/mod.rs
index 42516b82e..83be9f779 100644
--- a/vendor/icu_provider_adapters/src/filter/mod.rs
+++ b/vendor/icu_provider_adapters/src/filter/mod.rs
@@ -51,6 +51,7 @@ use icu_provider::prelude::*;
/// Although this struct can be created directly, the traits in this module provide helper
/// functions for common filtering patterns.
#[allow(clippy::exhaustive_structs)] // this type is stable
+#[derive(Debug)]
pub struct RequestFilterDataProvider<D, F>
where
F: Fn(DataRequest) -> bool,
diff --git a/vendor/icu_provider_adapters/src/fork/by_error.rs b/vendor/icu_provider_adapters/src/fork/by_error.rs
index b3badb147..aae996761 100644
--- a/vendor/icu_provider_adapters/src/fork/by_error.rs
+++ b/vendor/icu_provider_adapters/src/fork/by_error.rs
@@ -125,6 +125,7 @@ where
///
/// [`MultiForkByErrorProvider`] does not support forking between [`DataProvider`]s. However, it
/// supports forking between [`AnyProvider`], [`BufferProvider`], and [`DynamicDataProvider`].
+#[derive(Debug)]
pub struct MultiForkByErrorProvider<P, F> {
providers: Vec<P>,
predicate: F,
diff --git a/vendor/icu_provider_adapters/src/helpers.rs b/vendor/icu_provider_adapters/src/helpers.rs
index 2b168f936..bddab0011 100644
--- a/vendor/icu_provider_adapters/src/helpers.rs
+++ b/vendor/icu_provider_adapters/src/helpers.rs
@@ -4,7 +4,7 @@
use icu_provider::prelude::*;
-pub(crate) fn result_is_err_missing_data_options<T>(result: &Result<T, DataError>) -> bool {
+pub(crate) fn result_is_err_missing_locale<T>(result: &Result<T, DataError>) -> bool {
matches!(
result,
Err(DataError {
diff --git a/vendor/icu_provider_adapters/src/lib.rs b/vendor/icu_provider_adapters/src/lib.rs
index 16361e891..81987f877 100644
--- a/vendor/icu_provider_adapters/src/lib.rs
+++ b/vendor/icu_provider_adapters/src/lib.rs
@@ -20,7 +20,7 @@
clippy::panic,
clippy::exhaustive_structs,
clippy::exhaustive_enums,
- // TODO(#2266): enable missing_debug_implementations,
+ missing_debug_implementations,
)
)]
#![warn(missing_docs)]