Bug 1878778 - Mark ICU4XDataStruct as dead code as it's never read from Rust. r=m_kato

Differential Revision: https://phabricator.services.mozilla.com/D200734
This commit is contained in:
Mike Hommey 2024-02-06 05:36:43 +00:00
parent 074fc85b24
commit da840cd693
4 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,13 @@
diff --git a/intl/icu_capi/src/data_struct.rs b/intl/icu_capi/src/data_struct.rs
index d66e20b117b58..60765cec2419a 100644
--- a/intl/icu_capi/src/data_struct.rs
+++ b/intl/icu_capi/src/data_struct.rs
@@ -20,7 +20,7 @@ pub mod ffi {
///
/// This can be used to construct a StructDataProvider.
#[diplomat::attr(dart, disable)]
- pub struct ICU4XDataStruct(pub(crate) AnyPayload);
+ pub struct ICU4XDataStruct(#[allow(dead_code)] AnyPayload);
impl ICU4XDataStruct {
/// Construct a new DecimalSymbolsV1 data struct.

View File

@ -10,6 +10,10 @@ A patch for icu_capi for clang and static analysis.
A patch for icu_capi to add explicit keyword A patch for icu_capi to add explicit keyword
### 004-dead-code.patch
A patch for icu_capi to mark the ICU4XDataStruct as dead code as it's never read from Rust.
### empty.toml ### empty.toml
Empty toml data for trie_data for icu_segmenter_data. Empty toml data for trie_data for icu_segmenter_data.

View File

@ -20,7 +20,7 @@ pub mod ffi {
/// ///
/// This can be used to construct a StructDataProvider. /// This can be used to construct a StructDataProvider.
#[diplomat::attr(dart, disable)] #[diplomat::attr(dart, disable)]
pub struct ICU4XDataStruct(pub(crate) AnyPayload); pub struct ICU4XDataStruct(#[allow(dead_code)] AnyPayload);
impl ICU4XDataStruct { impl ICU4XDataStruct {
/// Construct a new DecimalSymbolsV1 data struct. /// Construct a new DecimalSymbolsV1 data struct.

View File

@ -83,6 +83,7 @@ for patch in \
001-Cargo.toml.patch \ 001-Cargo.toml.patch \
002-GH4109.patch \ 002-GH4109.patch \
003-explicit.patch \ 003-explicit.patch \
004-dead-code.patch \
; do ; do
patch -d ${top_src_dir} -p1 --no-backup-if-mismatch < ${top_src_dir}/intl/icu4x-patches/$patch patch -d ${top_src_dir} -p1 --no-backup-if-mismatch < ${top_src_dir}/intl/icu4x-patches/$patch
done done