Skip to content

Commit

Permalink
Audit more data markers (#6229)
Browse files Browse the repository at this point in the history
Segmenter and properties

#4991
  • Loading branch information
robertbastian authored Mar 5, 2025
1 parent 61950ac commit 19a1d38
Show file tree
Hide file tree
Showing 881 changed files with 11,473 additions and 11,448 deletions.
8 changes: 4 additions & 4 deletions components/calendar/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const _: () = {
impl_calendar_islamic_ummalqura_v1!(Baked);
impl_calendar_japanese_modern_v1!(Baked);
impl_calendar_japanese_extended_v1!(Baked);
impl_calendar_week_v2!(Baked);
impl_calendar_week_v1!(Baked);
};

icu_provider::data_marker!(
Expand All @@ -71,8 +71,8 @@ icu_provider::data_marker!(
);
icu_provider::data_marker!(
/// Week information
CalendarWeekV2,
"calendar/week/v2",
CalendarWeekV1,
"calendar/week/v1",
WeekData,
fallback_config = {
let mut config = LocaleFallbackConfig::default();
Expand All @@ -90,7 +90,7 @@ pub const MARKERS: &[DataMarkerInfo] = &[
CalendarIslamicUmmalquraV1::INFO,
CalendarJapaneseModernV1::INFO,
CalendarJapaneseExtendedV1::INFO,
CalendarWeekV2::INFO,
CalendarWeekV1::INFO,
];

/// The date at which an era started
Expand Down
4 changes: 2 additions & 2 deletions components/calendar/src/week_of.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ impl WeekCalculator {
#[doc = icu_provider::gen_buffer_unstable_docs!(UNSTABLE, Self::try_new)]
pub fn try_new_unstable<P>(provider: &P, prefs: WeekPreferences) -> Result<Self, DataError>
where
P: DataProvider<crate::provider::CalendarWeekV2> + ?Sized,
P: DataProvider<crate::provider::CalendarWeekV1> + ?Sized,
{
let locale = CalendarWeekV2::make_locale(prefs.locale_preferences);
let locale = CalendarWeekV1::make_locale(prefs.locale_preferences);
provider
.load(DataRequest {
id: DataIdentifierBorrowed::for_locale(&locale),
Expand Down
6 changes: 3 additions & 3 deletions components/casemap/src/titlecase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{CaseMapper, CaseMapperBorrowed};
use alloc::string::String;
use icu_locale_core::LanguageIdentifier;
use icu_properties::props::{GeneralCategory, GeneralCategoryGroup};
use icu_properties::provider::GeneralCategoryV1;
use icu_properties::provider::PropertyEnumGeneralCategoryV1;
use icu_properties::{CodePointMapData, CodePointMapDataBorrowed};
use icu_provider::prelude::*;
use writeable::Writeable;
Expand Down Expand Up @@ -223,7 +223,7 @@ impl TitlecaseMapper<CaseMapper> {
#[doc = icu_provider::gen_buffer_unstable_docs!(UNSTABLE, Self::new)]
pub fn try_new_unstable<P>(provider: &P) -> Result<Self, DataError>
where
P: DataProvider<CaseMapV1> + DataProvider<GeneralCategoryV1> + ?Sized,
P: DataProvider<CaseMapV1> + DataProvider<PropertyEnumGeneralCategoryV1> + ?Sized,
{
let cm = CaseMapper::try_new_unstable(provider)?;
let gc = icu_properties::CodePointMapData::<icu_properties::props::GeneralCategory>::try_new_unstable(provider)?;
Expand Down Expand Up @@ -272,7 +272,7 @@ impl<CM: AsRef<CaseMapper>> TitlecaseMapper<CM> {
#[doc = icu_provider::gen_buffer_unstable_docs!(UNSTABLE, Self::new_with_mapper)]
pub fn try_new_with_mapper_unstable<P>(provider: &P, casemapper: CM) -> Result<Self, DataError>
where
P: DataProvider<CaseMapV1> + DataProvider<GeneralCategoryV1> + ?Sized,
P: DataProvider<CaseMapV1> + DataProvider<PropertyEnumGeneralCategoryV1> + ?Sized,
{
let gc = icu_properties::CodePointMapData::<icu_properties::props::GeneralCategory>::try_new_unstable(provider)?;
Ok(Self { cm: casemapper, gc })
Expand Down
2 changes: 1 addition & 1 deletion components/datetime/src/external_loaders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub(crate) struct ExternalLoaderUnstable<'a, P: ?Sized>(pub &'a P);
impl<P> DecimalFormatterLoader for ExternalLoaderUnstable<'_, P>
where
P: ?Sized
+ DataProvider<icu_decimal::provider::DecimalSymbolsV2>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV1>
+ DataProvider<icu_decimal::provider::DecimalDigitsV1>,
{
#[inline]
Expand Down
8 changes: 4 additions & 4 deletions components/datetime/src/pattern/names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use icu_calendar::types::MonthCode;
use icu_calendar::AnyCalendar;
use icu_decimal::options::DecimalFormatterOptions;
use icu_decimal::options::GroupingStrategy;
use icu_decimal::provider::{DecimalDigitsV1, DecimalSymbolsV2};
use icu_decimal::provider::{DecimalDigitsV1, DecimalSymbolsV1};
use icu_decimal::DecimalFormatter;
use icu_provider::prelude::*;

Expand Down Expand Up @@ -710,7 +710,7 @@ impl<C, FSet: DateTimeNamesMarker> FixedCalendarDateTimeNames<C, FSet> {
prefs: DateTimeFormatterPreferences,
) -> Result<Self, DataError>
where
P: DataProvider<DecimalSymbolsV2> + DataProvider<DecimalDigitsV1> + ?Sized,
P: DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
{
let mut names = Self {
prefs,
Expand Down Expand Up @@ -2024,7 +2024,7 @@ impl<C, FSet: DateTimeNamesMarker> FixedCalendarDateTimeNames<C, FSet> {
#[inline]
pub fn load_decimal_formatter<P>(&mut self, provider: &P) -> Result<&mut Self, DataError>
where
P: DataProvider<DecimalSymbolsV2> + DataProvider<DecimalDigitsV1> + ?Sized,
P: DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1> + ?Sized,
{
self.inner
.load_decimal_formatter(&ExternalLoaderUnstable(provider), self.prefs)?;
Expand Down Expand Up @@ -2105,7 +2105,7 @@ impl<C: CldrCalendar, FSet: DateTimeNamesMarker> FixedCalendarDateTimeNames<C, F
+ DataProvider<tz::MzSpecificLongV1>
+ DataProvider<tz::MzSpecificShortV1>
+ DataProvider<tz::MzPeriodV1>
+ DataProvider<DecimalSymbolsV2>
+ DataProvider<DecimalSymbolsV1>
+ DataProvider<DecimalDigitsV1>
+ ?Sized,
{
Expand Down
10 changes: 5 additions & 5 deletions components/datetime/src/scaffold/fieldset_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use icu_calendar::{
types::{DayOfMonth, DayOfYearInfo, MonthInfo, Weekday, YearInfo},
Date, Iso,
};
use icu_decimal::provider::{DecimalDigitsV1, DecimalSymbolsV2};
use icu_decimal::provider::{DecimalDigitsV1, DecimalSymbolsV1};
use icu_provider::{marker::NeverMarker, prelude::*};
use icu_time::scaffold::IntoOption;
use icu_time::{
Expand Down Expand Up @@ -523,12 +523,12 @@ where
/// for datetime formatting with a fixed calendar.
// This trait is implicitly sealed due to sealed supertraits
pub trait AllFixedCalendarExternalDataMarkers:
DataProvider<DecimalSymbolsV2> + DataProvider<DecimalDigitsV1>
DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1>
{
}

impl<T> AllFixedCalendarExternalDataMarkers for T where
T: ?Sized + DataProvider<DecimalSymbolsV2> + DataProvider<DecimalDigitsV1>
T: ?Sized + DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1>
{
}

Expand All @@ -542,7 +542,7 @@ pub trait AllAnyCalendarExternalDataMarkers:
+ DataProvider<CalendarIslamicUmmalquraV1>
+ DataProvider<CalendarJapaneseModernV1>
+ DataProvider<CalendarJapaneseExtendedV1>
+ DataProvider<DecimalSymbolsV2>
+ DataProvider<DecimalSymbolsV1>
+ DataProvider<DecimalDigitsV1>
{
}
Expand All @@ -555,7 +555,7 @@ impl<T> AllAnyCalendarExternalDataMarkers for T where
+ DataProvider<CalendarIslamicUmmalquraV1>
+ DataProvider<CalendarJapaneseModernV1>
+ DataProvider<CalendarJapaneseExtendedV1>
+ DataProvider<DecimalSymbolsV2>
+ DataProvider<DecimalSymbolsV1>
+ DataProvider<DecimalDigitsV1>
{
}
Expand Down
2 changes: 1 addition & 1 deletion components/datetime/tests/data/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ GregorianDateLengthsV1 \
GregorianDateSymbolsV1 \
TimeLengthsV1 \
TimeSymbolsV1 \
DecimalSymbolsV2Marker \
DecimalSymbolsV1Marker \
TimeZoneFormatsV1 \
MetazoneSpecificNamesShortV1 \
--locales en \
Expand Down
4 changes: 2 additions & 2 deletions components/decimal/src/grouper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ fn test_grouper() {
};
let digits = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
struct Provider(RefCell<Option<DecimalSymbols<'static>>>, [char; 10]);
impl DataProvider<DecimalSymbolsV2> for Provider {
impl DataProvider<DecimalSymbolsV1> for Provider {
fn load(
&self,
_req: icu_provider::DataRequest,
) -> Result<icu_provider::DataResponse<DecimalSymbolsV2>, icu_provider::DataError>
) -> Result<icu_provider::DataResponse<DecimalSymbolsV1>, icu_provider::DataError>
{
Ok(DataResponse {
metadata: Default::default(),
Expand Down
10 changes: 5 additions & 5 deletions components/decimal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub mod input {
#[derive(Debug, Clone)]
pub struct DecimalFormatter {
options: options::DecimalFormatterOptions,
symbols: DataPayload<provider::DecimalSymbolsV2>,
symbols: DataPayload<provider::DecimalSymbolsV1>,
digits: DataPayload<provider::DecimalDigitsV1>,
}

Expand All @@ -181,13 +181,13 @@ impl DecimalFormatter {

#[doc = icu_provider::gen_buffer_unstable_docs!(UNSTABLE, Self::try_new)]
pub fn try_new_unstable<
D: DataProvider<provider::DecimalSymbolsV2> + DataProvider<provider::DecimalDigitsV1> + ?Sized,
D: DataProvider<provider::DecimalSymbolsV1> + DataProvider<provider::DecimalDigitsV1> + ?Sized,
>(
provider: &D,
prefs: DecimalFormatterPreferences,
options: options::DecimalFormatterOptions,
) -> Result<Self, DataError> {
let locale = provider::DecimalSymbolsV2::make_locale(prefs.locale_preferences);
let locale = provider::DecimalSymbolsV1::make_locale(prefs.locale_preferences);
let provided_nu = prefs.numbering_system.as_ref().map(|s| s.as_str());

// In case the user explicitly specified a numbering system, use digits from that numbering system. In case of explicitly specified numbering systems,
Expand All @@ -212,7 +212,7 @@ impl DecimalFormatter {

if let Some(provided_nu) = provided_nu {
// Load symbols for the locale/numsys pair provided
let symbols: DataPayload<provider::DecimalSymbolsV2> = provider
let symbols: DataPayload<provider::DecimalSymbolsV1> = provider
.load(DataRequest {
id: DataIdentifierBorrowed::for_marker_attributes_and_locale(
DataMarkerAttributes::from_str_or_panic(provided_nu),
Expand Down Expand Up @@ -259,7 +259,7 @@ impl DecimalFormatter {
digits,
})
} else {
let symbols: DataPayload<provider::DecimalSymbolsV2> = provider
let symbols: DataPayload<provider::DecimalSymbolsV1> = provider
.load(DataRequest {
id: DataIdentifierBorrowed::for_marker_attributes_and_locale(
DataMarkerAttributes::empty(),
Expand Down
8 changes: 4 additions & 4 deletions components/decimal/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ const _: () = {
pub use icu_decimal_data::icu_locale as locale;
}
make_provider!(Baked);
impl_decimal_symbols_v2!(Baked);
impl_decimal_symbols_v1!(Baked);
impl_decimal_digits_v1!(Baked);
};

icu_provider::data_marker!(
/// Data marker for decimal symbols
DecimalSymbolsV2,
"decimal/symbols/v2",
DecimalSymbolsV1,
"decimal/symbols/v1",
DecimalSymbols<'static>,
);

Expand All @@ -150,7 +150,7 @@ icu_provider::data_marker!(

#[cfg(feature = "datagen")]
/// The latest minimum set of markers required by this component.
pub const MARKERS: &[DataMarkerInfo] = &[DecimalSymbolsV2::INFO, DecimalDigitsV1::INFO];
pub const MARKERS: &[DataMarkerInfo] = &[DecimalSymbolsV1::INFO, DecimalDigitsV1::INFO];

/// A collection of settings expressing where to put grouping separators in a decimal number.
/// For example, `1,000,000` has two grouping separators, positioned along every 3 digits.
Expand Down
4 changes: 2 additions & 2 deletions components/experimental/src/compactdecimal/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl CompactDecimalFormatter {
) -> Result<Self, DataError>
where
D: DataProvider<ShortCompactDecimalFormatDataV1>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV2>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV1>
+ DataProvider<icu_decimal::provider::DecimalDigitsV1>
+ DataProvider<icu_plurals::provider::PluralsCardinalV1>
+ ?Sized,
Expand Down Expand Up @@ -230,7 +230,7 @@ impl CompactDecimalFormatter {
) -> Result<Self, DataError>
where
D: DataProvider<LongCompactDecimalFormatDataV1>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV2>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV1>
+ DataProvider<icu_decimal::provider::DecimalDigitsV1>
+ DataProvider<icu_plurals::provider::PluralsCardinalV1>
+ ?Sized,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl CompactCurrencyFormatter {
+ DataProvider<crate::dimension::provider::currency::CurrencyEssentialsV1>
+ DataProvider<crate::dimension::provider::currency_compact::ShortCurrencyCompactV1>
+ DataProvider<crate::compactdecimal::provider::ShortCompactDecimalFormatDataV1>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV2>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV1>
+ DataProvider<icu_decimal::provider::DecimalDigitsV1>
+ DataProvider<icu_plurals::provider::PluralsCardinalV1>,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl CurrencyFormatter {
where
D: ?Sized
+ DataProvider<super::super::provider::currency::CurrencyEssentialsV1>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV2>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV1>
+ DataProvider<icu_decimal::provider::DecimalDigitsV1>,
{
let locale = CurrencyEssentialsV1::make_locale(prefs.locale_preferences);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl LongCompactCurrencyFormatter {
D: ?Sized
+ DataProvider<crate::dimension::provider::extended_currency::CurrencyExtendedDataV1>
+ DataProvider<crate::dimension::provider::currency_patterns::CurrencyPatternsDataV1>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV2>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV1>
+ DataProvider<icu_decimal::provider::DecimalDigitsV1>
+ DataProvider<icu_plurals::provider::PluralsCardinalV1>
+ DataProvider<crate::compactdecimal::provider::LongCompactDecimalFormatDataV1>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ impl LongCurrencyFormatter {
D: ?Sized
+ DataProvider<super::super::provider::extended_currency::CurrencyExtendedDataV1>
+ DataProvider<super::super::provider::currency_patterns::CurrencyPatternsDataV1>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV2>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV1>
+ DataProvider<icu_decimal::provider::DecimalDigitsV1>
+ DataProvider<icu_plurals::provider::PluralsCardinalV1>,
{
Expand Down
2 changes: 1 addition & 1 deletion components/experimental/src/dimension/percent/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl PercentFormatter<DecimalFormatter> {
where
D: ?Sized
+ DataProvider<super::super::provider::percent::PercentEssentialsV1>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV2>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV1>
+ DataProvider<icu_decimal::provider::DecimalDigitsV1>,
{
let decimal_formatter = DecimalFormatter::try_new_unstable(
Expand Down
2 changes: 1 addition & 1 deletion components/experimental/src/dimension/units/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl UnitsFormatter {
where
D: ?Sized
+ DataProvider<super::super::provider::units::UnitsDisplayNameV1>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV2>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV1>
+ DataProvider<icu_decimal::provider::DecimalDigitsV1>
+ DataProvider<icu_plurals::provider::PluralsCardinalV1>,
{
Expand Down
8 changes: 4 additions & 4 deletions components/experimental/src/duration/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use super::validated_options::Unit;
use super::{provider, Duration};

pub use super::validated_options::ValidatedDurationFormatterOptions;
use icu_decimal::provider::{DecimalDigitsV1, DecimalSymbolsV2};
use icu_decimal::provider::{DecimalDigitsV1, DecimalSymbolsV1};
use icu_decimal::{DecimalFormatter, DecimalFormatterPreferences};
use icu_list::{options::ListLength, ListFormatter, ListFormatterPreferences};
use icu_locale_core::preferences::{
Expand Down Expand Up @@ -136,7 +136,7 @@ impl DurationUnitFormatter {
fn try_new_unstable<
D: ?Sized
+ DataProvider<UnitsDisplayNameV1>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV2>
+ DataProvider<icu_decimal::provider::DecimalSymbolsV1>
+ DataProvider<icu_decimal::provider::DecimalDigitsV1>
+ DataProvider<icu_plurals::provider::PluralsCardinalV1>,
>(
Expand Down Expand Up @@ -232,10 +232,10 @@ impl DurationFormatter {
pub fn try_new_unstable<
D: DataProvider<provider::DigitalDurationDataV1>
+ DataProvider<UnitsDisplayNameV1>
+ DataProvider<DecimalSymbolsV2>
+ DataProvider<DecimalSymbolsV1>
+ DataProvider<DecimalDigitsV1>
+ DataProvider<icu_plurals::provider::PluralsCardinalV1>
+ DataProvider<icu_list::provider::ListUnitV2>
+ DataProvider<icu_list::provider::ListUnitV1>
+ ?Sized,
>(
provider: &D,
Expand Down
4 changes: 2 additions & 2 deletions components/experimental/src/personnames/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ impl PersonNamesFormatter {
) -> Result<PersonNamesFormatter, PersonNamesFormatterError>
where
P: ?Sized
+ DataProvider<icu_properties::provider::ScriptWithExtensionsPropertyV1>
+ DataProvider<icu_properties::provider::ScriptValueToShortNameV1>
+ DataProvider<icu_properties::provider::PropertyScriptWithExtensionsV1>
+ DataProvider<icu_properties::provider::PropertyNameShortScriptV1>
+ DataProvider<icu_locale::provider::LocaleLikelySubtagsLanguageV1>
+ DataProvider<icu_locale::provider::LocaleParentsV1>,
{
Expand Down
4 changes: 2 additions & 2 deletions components/experimental/src/relativetime/relativetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use fixed_decimal::{Decimal, Sign};
use icu_decimal::{
options::DecimalFormatterOptions, provider::DecimalDigitsV1, provider::DecimalSymbolsV2,
options::DecimalFormatterOptions, provider::DecimalDigitsV1, provider::DecimalSymbolsV1,
DecimalFormatter, DecimalFormatterPreferences,
};
use icu_locale_core::preferences::{define_preferences, prefs_convert};
Expand Down Expand Up @@ -179,7 +179,7 @@ macro_rules! constructor {
where
D: DataProvider<PluralsCardinalV1>
+ DataProvider<$marker>
+ DataProvider<DecimalSymbolsV2> + DataProvider<DecimalDigitsV1>
+ DataProvider<DecimalSymbolsV1> + DataProvider<DecimalDigitsV1>
+ ?Sized,
{
let locale = <$marker>::make_locale(prefs.locale_preferences);
Expand Down
Loading

0 comments on commit 19a1d38

Please sign in to comment.