Files
rust/tests/ui/issues/issue-3656.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
466 B
Rust
Raw Normal View History

//@ run-pass
#![allow(dead_code)]
#![allow(improper_ctypes)]
// Issue #3656
// Incorrect struct size computation in the FFI, because of not taking
// the alignment of elements into account.
use std::ffi::{c_uint, c_void};
pub struct KEYGEN {
hash_algorithm: [c_uint; 2],
2019-06-01 15:37:54 +02:00
count: u32,
2014-06-25 12:47:34 -07:00
salt: *const c_void,
2019-06-01 15:37:54 +02:00
salt_size: u32,
}
2020-09-01 17:12:52 -04:00
extern "C" {
// Bogus signature, just need to test if it compiles.
2013-05-07 21:33:31 -07:00
pub fn malloc(data: KEYGEN);
}
2020-09-01 17:12:52 -04:00
pub fn main() {}