This is an automated email from the ASF dual-hosted git repository.

xuanwo pushed a commit to branch fix/remove-assert-size-tests
in repository https://gitbox.apache.org/repos/asf/opendal.git

commit 7125bc852eeb6efce5c305198d55aec25020e365
Author: Xuanwo <[email protected]>
AuthorDate: Wed Jan 28 19:03:12 2026 +0800

    fix(core): remove assert_size tests
---
 core/core/src/lib.rs         | 14 --------------
 core/core/src/types/error.rs | 11 -----------
 2 files changed, 25 deletions(-)

diff --git a/core/core/src/lib.rs b/core/core/src/lib.rs
index 5d9039efd..ab4d95aa5 100644
--- a/core/core/src/lib.rs
+++ b/core/core/src/lib.rs
@@ -173,21 +173,7 @@ pub mod services;
 
 #[cfg(test)]
 mod tests {
-    use std::mem::size_of;
-
     use super::*;
-    /// This is not a real test case.
-    ///
-    /// We assert our public structs here to make sure we don't introduce
-    /// unexpected struct/enum size change.
-    #[cfg(target_pointer_width = "64")]
-    #[test]
-    fn assert_size() {
-        assert_eq!(16, size_of::<Operator>());
-        assert_eq!(360, size_of::<Entry>());
-        assert_eq!(336, size_of::<Metadata>());
-        assert_eq!(1, size_of::<EntryMode>());
-    }
 
     trait AssertSendSync: Send + Sync {}
     impl AssertSendSync for Entry {}
diff --git a/core/core/src/types/error.rs b/core/core/src/types/error.rs
index 2639b9e1b..998cdd4c5 100644
--- a/core/core/src/types/error.rs
+++ b/core/core/src/types/error.rs
@@ -507,7 +507,6 @@ impl From<Error> for io::Error {
 
 #[cfg(test)]
 mod tests {
-    use std::mem::size_of;
     use std::sync::LazyLock;
 
     use anyhow::anyhow;
@@ -528,16 +527,6 @@ mod tests {
         backtrace: None,
     });
 
-    /// This is not a real test case.
-    ///
-    /// We assert our public structs here to make sure we don't introduce
-    /// unexpected struct/enum size change.
-    #[cfg(target_pointer_width = "64")]
-    #[test]
-    fn assert_size() {
-        assert_eq!(88, size_of::<Error>());
-    }
-
     #[test]
     fn test_error_display() {
         let s = format!("{}", LazyLock::force(&TEST_ERROR));

Reply via email to