summaryrefslogtreecommitdiffstats
path: root/tests/ui/feature-gates/feature-gate-type_alias_impl_trait.rs
blob: 3f49020bbea38466a0c1b8432a8f6414291a1221 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// check-pass
#![feature(type_alias_impl_trait)]
use std::fmt::Debug;

type Foo = impl Debug;

struct Bar(Foo);
fn define() -> Bar {
    Bar(42)
}

type Foo2 = impl Debug;

fn define2(_: Foo2) {
    let x = || -> Foo2 { 42 };
}

type Foo3 = impl Debug;

fn define3(x: Foo3) {
    let y: i32 = x;
}
fn define3_1(_: Foo3) {
    define3(42)
}

type Foo4 = impl Debug;

fn define4(_: Foo4) {
    let y: Foo4 = 42;
}

fn main() {}