-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Open
Labels
A-alignArea: alignment control (`repr(align(N))` and so on)Area: alignment control (`repr(align(N))` and so on)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-reprArea: the `#[repr(stuff)]` attributeArea: the `#[repr(stuff)]` attributeC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
#![allow(non_camel_case_types)]
pub enum c_void {}
type uintptr_t = usize;
type int16_t = u16;
type uint16_t = int16_t;
type uint32_t = u32;
type intptr_t = uintptr_t;
#[repr(C)]
#[repr(align(4))]
pub struct kevent {
pub ident: uintptr_t,
pub filter: int16_t,
pub flags: uint16_t,
pub fflags: uint32_t,
pub data: intptr_t,
pub udata: *mut c_void,
}
fn main() {
assert_eq!(::std::mem::align_of::<kevent>(), 4); // ERROR: 8 != 4
}
No warning, no error, nu nothing.
This is rust-lang/libc#914
jtmoon79
Metadata
Metadata
Assignees
Labels
A-alignArea: alignment control (`repr(align(N))` and so on)Area: alignment control (`repr(align(N))` and so on)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-reprArea: the `#[repr(stuff)]` attributeArea: the `#[repr(stuff)]` attributeC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.