From cccc3109ffc61a742bcaa9241e457ceadb96ce95 Mon Sep 17 00:00:00 2001 From: David Wood Date: Tue, 14 Jul 2020 19:26:34 +0100 Subject: lint: use `transparent_newtype_field` to avoid ICE This commit re-uses the `transparent_newtype_field` function instead of manually calling `is_zst` on normalized fields to determine which field in a transparent type is the non-zero-sized field, thus avoiding an ICE. Signed-off-by: David Wood --- src/test/ui/lint/lint-ctypes-73747.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/test/ui/lint/lint-ctypes-73747.rs (limited to 'src/test') diff --git a/src/test/ui/lint/lint-ctypes-73747.rs b/src/test/ui/lint/lint-ctypes-73747.rs new file mode 100644 index 00000000000..293ffd5c28e --- /dev/null +++ b/src/test/ui/lint/lint-ctypes-73747.rs @@ -0,0 +1,14 @@ +// check-pass + +#[repr(transparent)] +struct NonNullRawComPtr { + inner: std::ptr::NonNull<::VTable>, +} + +trait ComInterface { + type VTable; +} + +extern "C" fn invoke(_: Option>) {} + +fn main() {} -- cgit 1.4.1-3-g733a5