about summary refs log tree commit diff
path: root/src/test/run-pass
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2016-07-01 18:36:54 +0300
committerEduard Burtescu <edy.burt@gmail.com>2016-08-12 06:43:34 +0300
commitab26dbb96f12af96877832e34973641747bd6db1 (patch)
tree102df7fe2376522d22a99e0d7137172b81b7d4ac /src/test/run-pass
parentd1d16c94c5ec007ce91ec306bdf06c8ee6f2d29a (diff)
rustc: always normalize projections in ty::layout regardless where they appear.
Diffstat (limited to 'src/test/run-pass')
-rw-r--r--src/test/run-pass/transmute-specialization.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/run-pass/transmute-specialization.rs b/src/test/run-pass/transmute-specialization.rs
new file mode 100644
index 00000000000..823def32270
--- /dev/null
+++ b/src/test/run-pass/transmute-specialization.rs
@@ -0,0 +1,23 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(specialization)]
+
+trait Specializable { type Output; }
+
+impl<T> Specializable for T {
+    default type Output = u16;
+}
+
+fn main() {
+    unsafe {
+        std::mem::transmute::<u16, <() as Specializable>::Output>(0);
+    }
+}