From ab26dbb96f12af96877832e34973641747bd6db1 Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Fri, 1 Jul 2016 18:36:54 +0300 Subject: rustc: always normalize projections in ty::layout regardless where they appear. --- src/test/run-pass/transmute-specialization.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 src/test/run-pass/transmute-specialization.rs (limited to 'src/test') 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 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#![feature(specialization)] + +trait Specializable { type Output; } + +impl Specializable for T { + default type Output = u16; +} + +fn main() { + unsafe { + std::mem::transmute::::Output>(0); + } +} -- cgit 1.4.1-3-g733a5