summaryrefslogtreecommitdiffstats
path: root/tests/ui/issues/issue-21174.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/issues/issue-21174.rs')
-rw-r--r--tests/ui/issues/issue-21174.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/issues/issue-21174.rs b/tests/ui/issues/issue-21174.rs
new file mode 100644
index 000000000..078274251
--- /dev/null
+++ b/tests/ui/issues/issue-21174.rs
@@ -0,0 +1,11 @@
+trait Trait<'a> {
+ type A;
+ type B;
+}
+
+fn foo<'a, T: Trait<'a>>(value: T::A) {
+ let new: T::B = unsafe { std::mem::transmute(value) };
+//~^ ERROR: cannot transmute between types of different sizes, or dependently-sized types
+}
+
+fn main() { }