diff --git a/src/bytes.rs b/src/bytes.rs
index b9626490c44d286dfa6657305dad135085f48317..6282cf4fb9e087bbdbafef7890e3ec2d1b8596d4 100644
--- a/src/bytes.rs
+++ b/src/bytes.rs
@@ -1940,8 +1940,11 @@ impl Inner {
 
     #[inline]
     fn inline_len(&self) -> usize {
-        let p: &usize = unsafe { mem::transmute(&self.arc) };
-        (p & INLINE_LEN_MASK) >> INLINE_LEN_OFFSET
+        // This is undefind behavior due to a data race, but experimental
+        // evidence shows that it works in practice (discussion:
+        // https://internals.rust-lang.org/t/bit-wise-reasoning-for-atomic-accesses/8853).
+        let p: *const usize = unsafe { mem::transmute(&self.arc) };
+        (unsafe { *p } & INLINE_LEN_MASK) >> INLINE_LEN_OFFSET
     }
 
     /// Set the length of the inline buffer. This is done by writing to the