Skip to content

Commit 6e1ed46

Browse files
committed
Merge branch 'main' into bidi
2 parents 06580be + 9df722f commit 6e1ed46

File tree

643 files changed

+94555
-85320
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

643 files changed

+94555
-85320
lines changed

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
- `zerofrom`
3838
- `zerotrie`
3939
- `zerovec`
40+
- 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.
41+
- 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)
42+
- 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)
4043
- `writeable`
4144

4245

CODEOWNERS

+6-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ components/calendar/ @Manishearth @sffc
1111
components/casemap/ @Manishearth
1212
components/collator/ @hsivonen @echeran
1313
components/collections/ @echeran
14-
components/datetime/ @zbraniecki @nordzilla
14+
components/datetime/ @sffc @zbraniecki
1515
components/decimal/ @sffc
1616
components/experimental/src/compactdecimal/ @eggrobin
1717
components/experimental/src/dimension/ @younies
@@ -24,8 +24,8 @@ components/locale_core/ @zbraniecki @nciric
2424
components/normalizer/ @hsivonen @echeran
2525
components/plurals/ @zbraniecki @sffc
2626
components/segmenter/ @aethanyc @makotokato @sffc
27-
components/timezone/ @nordzilla
28-
tutorials/gn/ @sffc
27+
components/timezone/ @nekevss @robertbastian @sffc
28+
tutorials/gn/ @sffc
2929
ffi/capi/ @Manishearth
3030
ffi/ecma402/ @filmil
3131
ffi/harfbuzz/ @hsivonen
@@ -39,13 +39,15 @@ tools/benchmark/binsize/ @gnrunge
3939
tools/depcheck/ @Manishearth
4040
tools/depcheck/src/allowlist.rs @unicode-org/icu4x-owners
4141
tools/make/ @Manishearth @sffc
42-
utils/bies/ @sffc
42+
utils/bies/ @sffc
4343
utils/databake @robertbastian @Manishearth
4444
utils/deduplicating_array @robertbastian
4545
utils/fixed_decimal/ @sffc @younies
46+
utils/izdtf @nekevss @sffc
4647
utils/litemap/ @Manishearth @sffc
4748
utils/pattern/ @zbraniecki
4849
utils/tinystr @zbraniecki @sffc
50+
utils/tzif @nordzilla
4951
utils/writeable/ @sffc @robertbastian
5052
utils/yoke/ @Manishearth @sffc
5153
utils/zerofrom @Manishearth @sffc

Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/datetime/src/format/neo.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -587,10 +587,10 @@ pub(crate) struct RawDateTimeNamesBorrowed<'l> {
587587
dayperiod_names: OptionalNames<FieldLength, &'l LinearNamesV1<'l>>,
588588
zone_essentials: OptionalNames<(), &'l tz::EssentialsV1<'l>>,
589589
exemplar_cities: OptionalNames<(), &'l tz::ExemplarCitiesV1<'l>>,
590-
mz_generic_long: OptionalNames<(), &'l tz::MzGenericLongV1<'l>>,
591-
mz_generic_short: OptionalNames<(), &'l tz::MzGenericShortV1<'l>>,
592-
mz_specific_long: OptionalNames<(), &'l tz::MzSpecificLongV1<'l>>,
593-
mz_specific_short: OptionalNames<(), &'l tz::MzSpecificShortV1<'l>>,
590+
mz_generic_long: OptionalNames<(), &'l tz::MzGenericV1<'l>>,
591+
mz_generic_short: OptionalNames<(), &'l tz::MzGenericV1<'l>>,
592+
mz_specific_long: OptionalNames<(), &'l tz::MzSpecificV1<'l>>,
593+
mz_specific_short: OptionalNames<(), &'l tz::MzSpecificV1<'l>>,
594594
pub(crate) fixed_decimal_formatter: Option<&'l FixedDecimalFormatter>,
595595
pub(crate) week_calculator: Option<&'l WeekCalculator>,
596596
}

components/datetime/src/neo_marker.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -1017,13 +1017,13 @@ pub trait ZoneMarkers: private::Sealed {
10171017
/// Marker for loading exemplar city names for time zone formatting
10181018
type ExemplarCitiesV1Marker: DataMarker<DataStruct = tz::ExemplarCitiesV1<'static>>;
10191019
/// Marker for loading generic short time zone names.
1020-
type GenericLongV1Marker: DataMarker<DataStruct = tz::MzGenericLongV1<'static>>;
1020+
type GenericLongV1Marker: DataMarker<DataStruct = tz::MzGenericV1<'static>>;
10211021
/// Marker for loading generic short time zone names.
1022-
type GenericShortV1Marker: DataMarker<DataStruct = tz::MzGenericShortV1<'static>>;
1022+
type GenericShortV1Marker: DataMarker<DataStruct = tz::MzGenericV1<'static>>;
10231023
/// Marker for loading generic short time zone names.
1024-
type SpecificLongV1Marker: DataMarker<DataStruct = tz::MzSpecificLongV1<'static>>;
1024+
type SpecificLongV1Marker: DataMarker<DataStruct = tz::MzSpecificV1<'static>>;
10251025
/// Marker for loading generic short time zone names.
1026-
type SpecificShortV1Marker: DataMarker<DataStruct = tz::MzSpecificShortV1<'static>>;
1026+
type SpecificShortV1Marker: DataMarker<DataStruct = tz::MzSpecificV1<'static>>;
10271027
}
10281028

10291029
/// A trait associating constants and types implementing various other traits
@@ -1145,10 +1145,10 @@ impl ZoneMarkers for NeoNeverMarker {
11451145
type TimeZoneVariantInput = NeverField;
11461146
type EssentialsV1Marker = NeverMarker<tz::EssentialsV1<'static>>;
11471147
type ExemplarCitiesV1Marker = NeverMarker<tz::ExemplarCitiesV1<'static>>;
1148-
type GenericLongV1Marker = NeverMarker<tz::MzGenericLongV1<'static>>;
1149-
type GenericShortV1Marker = NeverMarker<tz::MzGenericShortV1<'static>>;
1150-
type SpecificLongV1Marker = NeverMarker<tz::MzSpecificLongV1<'static>>;
1151-
type SpecificShortV1Marker = NeverMarker<tz::MzSpecificShortV1<'static>>;
1148+
type GenericLongV1Marker = NeverMarker<tz::MzGenericV1<'static>>;
1149+
type GenericShortV1Marker = NeverMarker<tz::MzGenericV1<'static>>;
1150+
type SpecificLongV1Marker = NeverMarker<tz::MzSpecificV1<'static>>;
1151+
type SpecificShortV1Marker = NeverMarker<tz::MzSpecificV1<'static>>;
11521152
}
11531153

11541154
/// A struct that supports formatting both a date and a time.
@@ -1504,16 +1504,16 @@ macro_rules! datetime_marker_helper {
15041504
NeverMarker<tz::ExemplarCitiesV1<'static>>
15051505
};
15061506
(@data/zone/generic_long,) => {
1507-
NeverMarker<tz::MzGenericLongV1<'static>>
1507+
NeverMarker<tz::MzGenericV1<'static>>
15081508
};
15091509
(@data/zone/generic_short,) => {
1510-
NeverMarker<tz::MzGenericShortV1<'static>>
1510+
NeverMarker<tz::MzGenericV1<'static>>
15111511
};
15121512
(@data/zone/specific_long,) => {
1513-
NeverMarker<tz::MzSpecificLongV1<'static>>
1513+
NeverMarker<tz::MzSpecificV1<'static>>
15141514
};
15151515
(@data/zone/specific_short,) => {
1516-
NeverMarker<tz::MzSpecificShortV1<'static>>
1516+
NeverMarker<tz::MzSpecificV1<'static>>
15171517
};
15181518
(@names/year, yes) => {
15191519
YearNamesV1Marker

components/datetime/src/pattern/runtime/pattern.rs

+10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use super::super::{reference, PatternError, PatternItem, TimeGranularity};
88
use alloc::vec::Vec;
99
use core::str::FromStr;
10+
use icu_plurals::provider::FourBitMetadata;
1011
use icu_provider::prelude::*;
1112
use zerovec::{ule::AsULE, ZeroSlice, ZeroVec};
1213

@@ -75,6 +76,15 @@ impl PatternMetadata {
7576
pub(crate) fn set_time_granularity(&mut self, time_granularity: TimeGranularity) {
7677
self.0 = time_granularity.ordinal();
7778
}
79+
80+
pub(crate) fn to_four_bit_metadata(self) -> FourBitMetadata {
81+
#[allow(clippy::unwrap_used)] // valid values for self.0 are 0, 1, 2, 3, or 4
82+
FourBitMetadata::try_from_byte(self.0).unwrap()
83+
}
84+
85+
pub(crate) fn from_u8(other: u8) -> Self {
86+
Self(TimeGranularity::from_ordinal(other).ordinal())
87+
}
7888
}
7989

8090
impl Default for PatternMetadata {

components/datetime/src/provider/calendar/skeletons.rs

+1-12
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,18 @@ use crate::{
77
skeleton::{reference::Skeleton, SkeletonError},
88
};
99
use core::convert::TryFrom;
10-
use icu_provider::prelude::*;
1110
use litemap::LiteMap;
1211

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

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

4938
impl TryFrom<&str> for SkeletonV1 {

components/datetime/src/provider/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
1818
pub mod calendar;
1919
pub(crate) mod date_time;
20+
pub mod packed_pattern;
2021
pub mod time_zones;
2122

2223
/// Module for new DateSymbols design

0 commit comments

Comments
 (0)