summaryrefslogtreecommitdiffstats
path: root/src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.rs
blob: 6dfd7f6840f1b8807daef10c35f9dc063d8b9c84 (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
34
// ignore-compare-mode-chalk
// 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() {
    let x = || -> Foo2 { 42 };
}

type Foo3 = impl Debug;

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

type Foo4 = impl Debug;

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

fn main() {}