summaryrefslogtreecommitdiffstats
path: root/tests/ui/extern/extern-types-size_of_val.rs
blob: 3b02ea28eaa28d44beac59efcc0935546214d33b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// run-pass
#![feature(extern_types)]

use std::mem::{align_of_val, size_of_val};

extern "C" {
    type A;
}

fn main() {
    let x: &A = unsafe { &*(1usize as *const A) };

    assert_eq!(size_of_val(x), 0);
    assert_eq!(align_of_val(x), 1);
}