rust/tests/ui/lint/issue-14309.rs

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

40 lines
528 B
Rust
Raw Normal View History

2014-10-27 22:37:07 +00:00
#![deny(improper_ctypes)]
#![allow(dead_code)]
struct A {
x: i32
}
#[repr(C, packed)]
struct B {
x: i32,
y: A
}
#[repr(C)]
struct C {
x: i32
}
type A2 = A;
type B2 = B;
type C2 = C;
#[repr(C)]
struct D {
x: C,
y: A
}
extern "C" {
2019-09-10 21:29:31 +00:00
fn foo(x: A); //~ ERROR type `A`, which is not FFI-safe
fn bar(x: B); //~ ERROR type `A`
fn baz(x: C);
fn qux(x: A2); //~ ERROR type `A`
fn quux(x: B2); //~ ERROR type `A`
fn corge(x: C2);
fn fred(x: D); //~ ERROR type `A`
}
fn main() { }