Rollup merge of #74340 - davidtwco:issue-73747-improper-ctypes-defns-is-zst-with-params, r=pnkfelix
lint: use `transparent_newtype_field` to avoid ICE Fixes #73747. This PR 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.
This commit is contained in:
commit
dbe7ed33cd
2 changed files with 30 additions and 16 deletions
14
src/test/ui/lint/lint-ctypes-73747.rs
Normal file
14
src/test/ui/lint/lint-ctypes-73747.rs
Normal 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() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue