]> git.proxmox.com Git - rustc.git/blob - src/test/ui/feature-gates/feature-gate-type_alias_impl_trait.rs
New upstream version 1.52.0~beta.3+dfsg1
[rustc.git] / src / test / ui / feature-gates / feature-gate-type_alias_impl_trait.rs
1 // ignore-compare-mode-chalk
2 #![feature(min_type_alias_impl_trait)]
3 use std::fmt::Debug;
4
5 type Foo = impl Debug;
6 //~^ ERROR could not find defining uses
7
8 struct Bar(Foo);
9 fn define() -> Bar {
10 Bar(42) //~ ERROR mismatched types
11 }
12
13 type Foo2 = impl Debug;
14
15 fn define2() {
16 let x = || -> Foo2 { 42 }; //~ ERROR not permitted here
17 }
18
19 type Foo3 = impl Debug;
20 //~^ ERROR could not find defining uses
21
22 fn define3(x: Foo3) {
23 let y: i32 = x; //~ ERROR mismatched types
24 }
25 fn define3_1() {
26 define3(42) //~ ERROR mismatched types
27 }
28
29 type Foo4 = impl Debug;
30 //~^ ERROR could not find defining uses
31
32 fn define4() {
33 let y: Foo4 = 42;
34 //~^ ERROR not permitted here
35 }
36
37 fn main() {}