about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-11-20 10:09:39 +0000
committerbors <bors@rust-lang.org>2022-11-20 10:09:39 +0000
commit9cdfe03b0601d5328406746a7923a8a4eaa0cf3c (patch)
tree99a05baf61e6eaf41ecd8dc27f83f0e612ec71b4 /src/test
parente07425d55b77fde99af2092a92109a0da0860692 (diff)
parent83332539dd19f61893846e907d55c9abd613d007 (diff)
downloadrust-9cdfe03b0601d5328406746a7923a8a4eaa0cf3c.tar.gz
rust-9cdfe03b0601d5328406746a7923a8a4eaa0cf3c.zip
Auto merge of #103390 - compiler-errors:metadata-mod-regions, r=eholk
Check fat pointer metadata compatibility modulo regions

Regions don't really mean anything anyways during hir typeck.

If this `erase_regions` makes anyone nervous, it's probably equally valid to just equate the types using a type relation, but regardless we should _not_ be using strict type equality while region variables are present.

Fixes #103384
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/cast/cast-pointee-projection.rs17
1 files changed, 17 insertions, 0 deletions
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 <Self as Tag<'_>>::Type) -> *mut <Self as Tag<'_>>::Type;
+}
+
+impl<T: for<'a> Tag<'a>> IntoRaw for T {
+    fn into_raw(this: *const <Self as Tag<'_>>::Type) -> *mut <Self as Tag<'_>>::Type {
+        this as *mut T::Type
+    }
+}
+
+fn main() {}