Skip to content

Commit

Permalink
Merge branch 'main' into bidi
Browse files Browse the repository at this point in the history
  • Loading branch information
robertbastian committed Sep 30, 2024
2 parents 06580be + 9df722f commit 6e1ed46
Show file tree
Hide file tree
Showing 643 changed files with 94,555 additions and 85,320 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
- `zerofrom`
- `zerotrie`
- `zerovec`
- This release has multiple changes that affect the bit representation of various types. Do not update to this release if you wish to retain stable data formats.
- Change the `VarZeroVecFormat` values shipped by default to use the same index and length width. This breaks data layout for all `VarZeroVec`s. (https://github.com/unicode-org/icu4x/pull/5594)
- Optimize `MultiFieldsULE` to not store a length anymore. This breaks data layout for any `#[make_varule]`-using struct with multiple variable-sized fields. (https://github.com/unicode-org/icu4x/pull/5593)
- `writeable`


Expand Down
10 changes: 6 additions & 4 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ components/calendar/ @Manishearth @sffc
components/casemap/ @Manishearth
components/collator/ @hsivonen @echeran
components/collections/ @echeran
components/datetime/ @zbraniecki @nordzilla
components/datetime/ @sffc @zbraniecki
components/decimal/ @sffc
components/experimental/src/compactdecimal/ @eggrobin
components/experimental/src/dimension/ @younies
Expand All @@ -24,8 +24,8 @@ components/locale_core/ @zbraniecki @nciric
components/normalizer/ @hsivonen @echeran
components/plurals/ @zbraniecki @sffc
components/segmenter/ @aethanyc @makotokato @sffc
components/timezone/ @nordzilla
tutorials/gn/ @sffc
components/timezone/ @nekevss @robertbastian @sffc
tutorials/gn/ @sffc
ffi/capi/ @Manishearth
ffi/ecma402/ @filmil
ffi/harfbuzz/ @hsivonen
Expand All @@ -39,13 +39,15 @@ tools/benchmark/binsize/ @gnrunge
tools/depcheck/ @Manishearth
tools/depcheck/src/allowlist.rs @unicode-org/icu4x-owners
tools/make/ @Manishearth @sffc
utils/bies/ @sffc
utils/bies/ @sffc
utils/databake @robertbastian @Manishearth
utils/deduplicating_array @robertbastian
utils/fixed_decimal/ @sffc @younies
utils/izdtf @nekevss @sffc
utils/litemap/ @Manishearth @sffc
utils/pattern/ @zbraniecki
utils/tinystr @zbraniecki @sffc
utils/tzif @nordzilla
utils/writeable/ @sffc @robertbastian
utils/yoke/ @Manishearth @sffc
utils/zerofrom @Manishearth @sffc
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions components/datetime/src/format/neo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,10 @@ pub(crate) struct RawDateTimeNamesBorrowed<'l> {
dayperiod_names: OptionalNames<FieldLength, &'l LinearNamesV1<'l>>,
zone_essentials: OptionalNames<(), &'l tz::EssentialsV1<'l>>,
exemplar_cities: OptionalNames<(), &'l tz::ExemplarCitiesV1<'l>>,
mz_generic_long: OptionalNames<(), &'l tz::MzGenericLongV1<'l>>,
mz_generic_short: OptionalNames<(), &'l tz::MzGenericShortV1<'l>>,
mz_specific_long: OptionalNames<(), &'l tz::MzSpecificLongV1<'l>>,
mz_specific_short: OptionalNames<(), &'l tz::MzSpecificShortV1<'l>>,
mz_generic_long: OptionalNames<(), &'l tz::MzGenericV1<'l>>,
mz_generic_short: OptionalNames<(), &'l tz::MzGenericV1<'l>>,
mz_specific_long: OptionalNames<(), &'l tz::MzSpecificV1<'l>>,
mz_specific_short: OptionalNames<(), &'l tz::MzSpecificV1<'l>>,
pub(crate) fixed_decimal_formatter: Option<&'l FixedDecimalFormatter>,
pub(crate) week_calculator: Option<&'l WeekCalculator>,
}
Expand Down
24 changes: 12 additions & 12 deletions components/datetime/src/neo_marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1017,13 +1017,13 @@ pub trait ZoneMarkers: private::Sealed {
/// Marker for loading exemplar city names for time zone formatting
type ExemplarCitiesV1Marker: DataMarker<DataStruct = tz::ExemplarCitiesV1<'static>>;
/// Marker for loading generic short time zone names.
type GenericLongV1Marker: DataMarker<DataStruct = tz::MzGenericLongV1<'static>>;
type GenericLongV1Marker: DataMarker<DataStruct = tz::MzGenericV1<'static>>;
/// Marker for loading generic short time zone names.
type GenericShortV1Marker: DataMarker<DataStruct = tz::MzGenericShortV1<'static>>;
type GenericShortV1Marker: DataMarker<DataStruct = tz::MzGenericV1<'static>>;
/// Marker for loading generic short time zone names.
type SpecificLongV1Marker: DataMarker<DataStruct = tz::MzSpecificLongV1<'static>>;
type SpecificLongV1Marker: DataMarker<DataStruct = tz::MzSpecificV1<'static>>;
/// Marker for loading generic short time zone names.
type SpecificShortV1Marker: DataMarker<DataStruct = tz::MzSpecificShortV1<'static>>;
type SpecificShortV1Marker: DataMarker<DataStruct = tz::MzSpecificV1<'static>>;
}

/// A trait associating constants and types implementing various other traits
Expand Down Expand Up @@ -1145,10 +1145,10 @@ impl ZoneMarkers for NeoNeverMarker {
type TimeZoneVariantInput = NeverField;
type EssentialsV1Marker = NeverMarker<tz::EssentialsV1<'static>>;
type ExemplarCitiesV1Marker = NeverMarker<tz::ExemplarCitiesV1<'static>>;
type GenericLongV1Marker = NeverMarker<tz::MzGenericLongV1<'static>>;
type GenericShortV1Marker = NeverMarker<tz::MzGenericShortV1<'static>>;
type SpecificLongV1Marker = NeverMarker<tz::MzSpecificLongV1<'static>>;
type SpecificShortV1Marker = NeverMarker<tz::MzSpecificShortV1<'static>>;
type GenericLongV1Marker = NeverMarker<tz::MzGenericV1<'static>>;
type GenericShortV1Marker = NeverMarker<tz::MzGenericV1<'static>>;
type SpecificLongV1Marker = NeverMarker<tz::MzSpecificV1<'static>>;
type SpecificShortV1Marker = NeverMarker<tz::MzSpecificV1<'static>>;
}

/// A struct that supports formatting both a date and a time.
Expand Down Expand Up @@ -1504,16 +1504,16 @@ macro_rules! datetime_marker_helper {
NeverMarker<tz::ExemplarCitiesV1<'static>>
};
(@data/zone/generic_long,) => {
NeverMarker<tz::MzGenericLongV1<'static>>
NeverMarker<tz::MzGenericV1<'static>>
};
(@data/zone/generic_short,) => {
NeverMarker<tz::MzGenericShortV1<'static>>
NeverMarker<tz::MzGenericV1<'static>>
};
(@data/zone/specific_long,) => {
NeverMarker<tz::MzSpecificLongV1<'static>>
NeverMarker<tz::MzSpecificV1<'static>>
};
(@data/zone/specific_short,) => {
NeverMarker<tz::MzSpecificShortV1<'static>>
NeverMarker<tz::MzSpecificV1<'static>>
};
(@names/year, yes) => {
YearNamesV1Marker
Expand Down
10 changes: 10 additions & 0 deletions components/datetime/src/pattern/runtime/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use super::super::{reference, PatternError, PatternItem, TimeGranularity};
use alloc::vec::Vec;
use core::str::FromStr;
use icu_plurals::provider::FourBitMetadata;
use icu_provider::prelude::*;
use zerovec::{ule::AsULE, ZeroSlice, ZeroVec};

Expand Down Expand Up @@ -75,6 +76,15 @@ impl PatternMetadata {
pub(crate) fn set_time_granularity(&mut self, time_granularity: TimeGranularity) {
self.0 = time_granularity.ordinal();
}

pub(crate) fn to_four_bit_metadata(self) -> FourBitMetadata {
#[allow(clippy::unwrap_used)] // valid values for self.0 are 0, 1, 2, 3, or 4
FourBitMetadata::try_from_byte(self.0).unwrap()
}

pub(crate) fn from_u8(other: u8) -> Self {
Self(TimeGranularity::from_ordinal(other).ordinal())
}
}

impl Default for PatternMetadata {
Expand Down
13 changes: 1 addition & 12 deletions components/datetime/src/provider/calendar/skeletons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,18 @@ use crate::{
skeleton::{reference::Skeleton, SkeletonError},
};
use core::convert::TryFrom;
use icu_provider::prelude::*;
use litemap::LiteMap;

size_test!(DateSkeletonPatternsV1, date_skeleton_patterns_v1_size, 24);

/// Skeleton data for dates and times, along with the corresponding plural pattern
/// information.
#[doc = date_skeleton_patterns_v1_size!()]
///
/// <div class="stab unstable">
/// 🚧 This code is considered unstable; it may change at any time, in breaking or non-breaking ways,
/// including in SemVer minor releases. While the serde representation of data structs is guaranteed
/// to be stable, their Rust representation might not be. Use with caution.
/// </div>
#[icu_provider::data_struct(DateSkeletonPatternsV1Marker = "datetime/skeletons@1")]
#[derive(Debug, PartialEq, Clone, Default)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct DateSkeletonPatternsV1<'data>(
#[cfg_attr(feature = "serde", serde(borrow))]
#[zerofrom(clone)]
pub LiteMap<SkeletonV1, PatternPlurals<'data>>,
);
pub struct DateSkeletonPatternsV1<'data>(pub LiteMap<SkeletonV1, PatternPlurals<'data>>);

/// This struct is a public wrapper around the internal `Skeleton` struct. This allows
/// access to the serialization and deserialization capabilities, without exposing the
Expand All @@ -43,7 +33,6 @@ pub struct DateSkeletonPatternsV1<'data>(
/// to be stable, their Rust representation might not be. Use with caution.
/// </div>
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize))]
pub struct SkeletonV1(pub Skeleton);

impl TryFrom<&str> for SkeletonV1 {
Expand Down
1 change: 1 addition & 0 deletions components/datetime/src/provider/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
pub mod calendar;
pub(crate) mod date_time;
pub mod packed_pattern;
pub mod time_zones;

/// Module for new DateSymbols design
Expand Down
Loading

0 comments on commit 6e1ed46

Please sign in to comment.