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 <david@davidtw.co>
This commit is contained in:
David Wood 2020-07-14 19:26:34 +01:00
parent c724b67e1b
commit cccc3109ff
No known key found for this signature in database
GPG key ID: 2592E76C87381FD9
2 changed files with 30 additions and 16 deletions

View file

@ -0,0 +1,14 @@
// check-pass
#[repr(transparent)]
struct NonNullRawComPtr<T: ComInterface> {
inner: std::ptr::NonNull<<T as ComInterface>::VTable>,
}
trait ComInterface {
type VTable;
}
extern "C" fn invoke<T: ComInterface>(_: Option<NonNullRawComPtr<T>>) {}
fn main() {}