]>
Commit | Line | Data |
---|---|---|
416331ca | 1 | // Issue 52985: user code provides no use case that allows a type alias `impl Trait` |
5e7ed085 | 2 | // We now emit a 'unconstrained opaque type' error |
416331ca | 3 | |
94222f64 | 4 | #![feature(type_alias_impl_trait)] |
416331ca | 5 | |
923072b8 FG |
6 | mod foo { |
7 | pub type Foo = impl Copy; | |
8 | //~^ ERROR unconstrained opaque type | |
416331ca | 9 | |
923072b8 FG |
10 | // make compiler happy about using 'Foo' |
11 | pub fn bar(x: Foo) -> Foo { | |
12 | x | |
13 | } | |
136023e0 | 14 | } |
416331ca XL |
15 | |
16 | fn main() { | |
923072b8 FG |
17 | let _: foo::Foo = std::mem::transmute(0u8); |
18 | //~^ ERROR cannot transmute between types of different sizes, or dependently-sized types | |
416331ca | 19 | } |