diff options
Diffstat (limited to 'tests/ui/union/issue-81199.rs')
-rw-r--r-- | tests/ui/union/issue-81199.rs | 21 |
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() {} |