mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 06:41:14 +00:00
Fix size assertion between OpaqueValue and Value
Make it an equals check, to match the comments further down when using transmute.
This commit is contained in:
parent
79612d7354
commit
f09ea8bf6f
1 changed files with 2 additions and 2 deletions
|
@ -748,8 +748,8 @@ pub(crate) mod ffi {
|
|||
|
||||
#[repr(C)]
|
||||
pub struct ValueOpaque([usize; 7]);
|
||||
/// Asserts that ValueOpaque is at least as large as Value, otherwise this would overflow
|
||||
const _: usize = std::mem::size_of::<ValueOpaque>() - std::mem::size_of::<Value>();
|
||||
/// Asserts that ValueOpaque is as large as Value and has the same alignment, to make transmute safe.
|
||||
const _: [(); std::mem::size_of::<ValueOpaque>()] = [(); std::mem::size_of::<Value>()];
|
||||
const _: [(); std::mem::align_of::<ValueOpaque>()] = [(); std::mem::align_of::<Value>()];
|
||||
|
||||
impl ValueOpaque {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue