]> git.proxmox.com Git - rustc.git/blame_incremental - src/test/ui/type-alias-impl-trait/type_of_a_let.rs
New upstream version 1.61.0+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / type_of_a_let.rs
... / ...
CommitLineData
1#![feature(type_alias_impl_trait)]
2#![allow(dead_code)]
3
4use std::fmt::Debug;
5
6type Foo = impl Debug;
7
8fn foo1() -> u32 {
9 let x: Foo = 22_u32;
10 x
11}
12
13fn foo2() -> u32 {
14 let x: Foo = 22_u32;
15 let y: Foo = x;
16 same_type((x, y)); //~ ERROR use of moved value
17 y //~ ERROR use of moved value
18}
19
20fn same_type<T>(x: (T, T)) {}
21
22fn main() {}