summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type-alias-impl-trait/type_of_a_let.rs
blob: 4e9d1788b94d833e6fca30adec602bbdaf3a141c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![feature(type_alias_impl_trait)]
#![allow(dead_code)]

use std::fmt::Debug;

type Foo = impl Debug;

fn foo1() -> u32 {
    let x: Foo = 22_u32;
    x
}

fn foo2() -> u32 {
    let x: Foo = 22_u32;
    let y: Foo = x;
    same_type((x, y)); //~ ERROR use of moved value
    y //~ ERROR use of moved value
}

fn same_type<T>(x: (T, T)) {}

fn main() {}