diff --git a/src/smallbox.rs b/src/smallbox.rs index 8a6e678..1531e38 100644 --- a/src/smallbox.rs +++ b/src/smallbox.rs @@ -137,7 +137,8 @@ impl SmallBox { // the value can be stored inline iff the size of T is equal or // smaller than the size of the boxed type and the alignment of the // boxed type is an integer multiple of the alignment of T - crate::can_transmute::>, T>() + (size_of::>>() >= size_of::>()) + & (align_of::>>() >= align_of::>()) } pub fn new(value: T) -> Self { diff --git a/src/util.rs b/src/util.rs index bcfc2c4..0570972 100644 --- a/src/util.rs +++ b/src/util.rs @@ -44,5 +44,5 @@ pub const fn can_transmute() -> bool { use core::mem::{align_of, size_of}; // We can transmute `A` to `B` iff `A` and `B` have the same size and the // alignment of `A` is greater than or equal to the alignment of `B`. - size_of::() <= size_of::() && align_of::() >= align_of::() + (size_of::() == size_of::()) & (align_of::() >= align_of::()) }