From 999a47ccd60724e9381a53f8713bf41029ffb8d2 Mon Sep 17 00:00:00 2001 From: garasubo Date: Mon, 22 Apr 2019 23:24:11 +0900 Subject: [PATCH] add repr Just make sure VolatileCell has the same ABI as T --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 5fed95e..e7c6957 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,6 +14,7 @@ use core::ptr; /// /// [`Cell`]: https://doc.rust-lang.org/std/cell/struct.Cell.html /// [volatile]: https://doc.rust-lang.org/std/ptr/fn.read_volatile.html +#[repr(transparent)] pub struct VolatileCell { value: UnsafeCell, }