]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/type_of_a_let.rs
Merge commit '39683d8eb7a32a74bea96ecbf1e87675d3338506' into sync_cg_gcc-2022-03-26
[rust.git] / src / test / ui / type-alias-impl-trait / type_of_a_let.rs
1 #![feature(type_alias_impl_trait)]
2 #![allow(dead_code)]
3
4 // FIXME This should compile, but it currently doesn't
5
6 use std::fmt::Debug;
7
8 type Foo = impl Debug;
9 //~^ ERROR: could not find defining uses
10
11 fn foo1() -> u32 {
12     let x: Foo = 22_u32;
13     //~^ ERROR: mismatched types [E0308]
14     x
15     //~^ ERROR: mismatched types [E0308]
16 }
17
18 fn foo2() -> u32 {
19     let x: Foo = 22_u32;
20     //~^ ERROR: mismatched types [E0308]
21     let y: Foo = x;
22     same_type((x, y));
23     y
24     //~^ ERROR: mismatched types [E0308]
25 }
26
27 fn same_type<T>(x: (T, T)) {}
28
29 fn main() {}