From 83332539dd19f61893846e907d55c9abd613d007 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sat, 22 Oct 2022 06:43:51 +0000 Subject: Check fat pointer metadata compatibility modulo regions --- src/test/ui/cast/cast-pointee-projection.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/test/ui/cast/cast-pointee-projection.rs (limited to 'src') diff --git a/src/test/ui/cast/cast-pointee-projection.rs b/src/test/ui/cast/cast-pointee-projection.rs new file mode 100644 index 00000000000..f51c5f20f16 --- /dev/null +++ b/src/test/ui/cast/cast-pointee-projection.rs @@ -0,0 +1,17 @@ +// check-pass + +trait Tag<'a> { + type Type: ?Sized; +} + +trait IntoRaw: for<'a> Tag<'a> { + fn into_raw(this: *const >::Type) -> *mut >::Type; +} + +impl Tag<'a>> IntoRaw for T { + fn into_raw(this: *const >::Type) -> *mut >::Type { + this as *mut T::Type + } +} + +fn main() {} -- cgit 1.4.1-3-g733a5