summaryrefslogtreecommitdiffstats
path: root/tests/ui/union/issue-81199.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/union/issue-81199.rs')
-rw-r--r--tests/ui/union/issue-81199.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/union/issue-81199.rs b/tests/ui/union/issue-81199.rs
new file mode 100644
index 000000000..628e7c6ed
--- /dev/null
+++ b/tests/ui/union/issue-81199.rs
@@ -0,0 +1,21 @@
+#[repr(C)]
+union PtrRepr<T: ?Sized> {
+ const_ptr: *const T,
+ mut_ptr: *mut T,
+ components: PtrComponents<T>,
+ //~^ ERROR the trait bound
+}
+
+#[repr(C)]
+struct PtrComponents<T: Pointee + ?Sized> {
+ data_address: *const (),
+ metadata: <T as Pointee>::Metadata,
+}
+
+
+
+pub trait Pointee {
+ type Metadata;
+}
+
+fn main() {}