From 1676ee451e455bdeca558790d5b660a9da74f962 Mon Sep 17 00:00:00 2001 From: "Shane F. Carr" Date: Thu, 7 Mar 2024 15:19:44 +0100 Subject: [PATCH 1/2] Add PhantomData databake impl --- utils/databake/src/primitives.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/utils/databake/src/primitives.rs b/utils/databake/src/primitives.rs index 37a8daeaa16..2373846046b 100644 --- a/utils/databake/src/primitives.rs +++ b/utils/databake/src/primitives.rs @@ -2,6 +2,8 @@ // called LICENSE at the top level of the ICU4X source tree // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). +use std::marker::PhantomData; + use super::*; macro_rules! literal { @@ -255,3 +257,19 @@ fn tuple() { const: (0u8, 0i8) ); } + +impl Bake for PhantomData { + fn bake(&self, _ctx: &CrateEnv) -> TokenStream { + quote! { + ::core::marker::PhantomData + } + } +} + +#[test] +fn phantom_data() { + test_bake!( + PhantomData, + const: ::core::marker::PhantomData + ); +} From ae713891c1f756056fd6744e208ced9670c3b50f Mon Sep 17 00:00:00 2001 From: "Shane F. Carr" Date: Thu, 7 Mar 2024 15:20:51 +0100 Subject: [PATCH 2/2] Changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53e113224a1..3a48bd3ca56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,8 @@ - Add Keviyah/Four Gates based optimized calculations module for the Hebrew calendar. (https://github.com/unicode-org/icu4x/pull/4504) - Expose `Hebrew` as a unit struct, add `Date::try_new_hebrew_date()`, `DateTime::try_new_hebrew_datetime()`. (https://github.com/unicode-org/icu4x/pulls/4532) - Deprecate `Hebrew::new_always_precomputing()`, `Date::try_new_hebrew_date_with_calendar()`, `DateTime::try_new_hebrew_datetime_with_calendar()`. The new implementation of the Hebrew calendar is faster and we do not need APIs for precomputation. (https://github.com/unicode-org/icu4x/pulls/4532) + - `databake` + - Add `impl Bake for PhantomData` (https://github.com/unicode-org/icu4x/pull/4663) - `litemap` - Add `impl IntoIterator for LiteMap` by splitting `StoreIterableMut` trait (https://github.com/unicode-org/icu4x/pull/4359) - `yoke`