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

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

25 lines
499 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.
//@ pretty-expanded FIXME #23616
use std::ffi::{c_uint, c_void};
pub struct KEYGEN {
hash_algorithm: [c_uint; 2],
2019-06-01 13:37:54 +00:00
count: u32,
2014-06-25 19:47:34 +00:00
salt: *const c_void,
2019-06-01 13:37:54 +00:00
salt_size: u32,
}
2020-09-01 21:12:52 +00:00
extern "C" {
// Bogus signature, just need to test if it compiles.
2013-05-08 04:33:31 +00:00
pub fn malloc(data: KEYGEN);
}
2020-09-01 21:12:52 +00:00
pub fn main() {}