From 6f2c051aba7d40b260ec6de4298f801164f569e4 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sat, 9 Sep 2023 13:05:12 +0200 Subject: [PATCH] add some DispatchFromDyn ABI compatibility tests --- tests/ui/abi/compatibility.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/ui/abi/compatibility.rs b/tests/ui/abi/compatibility.rs index 8b7236bf42f..b3e75bb8233 100644 --- a/tests/ui/abi/compatibility.rs +++ b/tests/ui/abi/compatibility.rs @@ -85,6 +85,11 @@ test_abi_compatible!(zst_unit, Zst, ()); test_abi_compatible!(zst_array, Zst, [u8; 0]); test_abi_compatible!(nonzero_int, NonZeroI32, i32); +// `DispatchFromDyn` relies on ABI compatibility. +// This is interesting since these types are not `repr(transparent)`. +test_abi_compatible!(rc, std::rc::Rc, *mut i32); +test_abi_compatible!(arc, std::sync::Arc, *mut i32); + // `repr(transparent)` compatibility. #[repr(transparent)] struct Wrapper1(T);