diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-02-08 10:19:47 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-02-08 10:19:47 -0500 |
| commit | f69259ecf8cc5577cd24065f9a5a6498cfff77db (patch) | |
| tree | d603c25e8572283234e8d647da5c0389c67c8fa6 /src/test/compile-fail | |
| parent | 10f6a5c4431e09d355a0ba319a630e02a1e38361 (diff) | |
| parent | e866d07f55b1b3ed6e37625ef35f61ac5c10f40e (diff) | |
Rollup merge of #39462 - emilio:improper-ctypes, r=nikomatsakis
lint/ctypes: Don't warn on sized structs with PhantomData. Fixes #34798
Diffstat (limited to 'src/test/compile-fail')
| -rw-r--r-- | src/test/compile-fail/lint-ctypes.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/test/compile-fail/lint-ctypes.rs b/src/test/compile-fail/lint-ctypes.rs index ccc25b58228..608b1eb0872 100644 --- a/src/test/compile-fail/lint-ctypes.rs +++ b/src/test/compile-fail/lint-ctypes.rs @@ -29,6 +29,9 @@ pub type RustBadRet = extern fn() -> Box<u32>; pub type CVoidRet = (); pub struct Foo; +#[repr(C)] +pub struct ZeroSizeWithPhantomData(::std::marker::PhantomData<i32>); + extern { pub fn ptr_type1(size: *const Foo); //~ ERROR: found struct without pub fn ptr_type2(size: *const Foo); //~ ERROR: found struct without @@ -40,6 +43,9 @@ extern { pub fn tuple_type(p: (i32, i32)); //~ ERROR found Rust tuple type pub fn tuple_type2(p: I32Pair); //~ ERROR found Rust tuple type pub fn zero_size(p: ZeroSize); //~ ERROR found zero-size struct + pub fn zero_size_phantom(p: ZeroSizeWithPhantomData); //~ ERROR found zero-sized type + pub fn zero_size_phantom_toplevel() + -> ::std::marker::PhantomData<bool>; //~ ERROR: found zero-sized type pub fn fn_type(p: RustFn); //~ ERROR found function pointer with Rust pub fn fn_type2(p: fn()); //~ ERROR found function pointer with Rust pub fn fn_contained(p: RustBadRet); //~ ERROR: found struct without |
