]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/type_of_a_let.rs
Rollup merge of #92917 - jackh726:issue-91762-2, r=nikomatsakis
[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 use std::fmt::Debug;
5
6 type Foo = impl Debug;
7
8 fn foo1() -> u32 {
9     let x: Foo = 22_u32;
10     x
11 }
12
13 fn 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
20 fn same_type<T>(x: (T, T)) {}
21
22 fn main() {}