]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/no_inferrable_concrete_type.rs
Auto merge of #106998 - matthiaskrgr:rollup-hmfisji, r=matthiaskrgr
[rust.git] / tests / ui / type-alias-impl-trait / no_inferrable_concrete_type.rs
1 // Issue 52985: user code provides no use case that allows a type alias `impl Trait`
2 // We now emit a 'unconstrained opaque type' error
3
4 #![feature(type_alias_impl_trait)]
5
6 mod foo {
7     pub type Foo = impl Copy;
8     //~^ ERROR unconstrained opaque type
9
10     // make compiler happy about using 'Foo'
11     pub fn bar(x: Foo) -> Foo {
12         x
13     }
14 }
15
16 fn main() {
17     let _: foo::Foo = std::mem::transmute(0u8);
18 }