]> git.proxmox.com Git - rustc.git/blob - src/test/ui/type-alias-impl-trait/argument-types.rs
New upstream version 1.56.0~beta.4+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / argument-types.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 // FIXME: This should compile, but it currently doesn't
9 fn foo1(mut x: Foo) {
10 x = 22_u32;
11 //~^ ERROR: mismatched types [E0308]
12 }
13
14 fn foo2(mut x: Foo) {
15 // no constraint on x
16 }
17
18 fn foo3(x: Foo) {
19 println!("{:?}", x);
20 }
21
22 fn foo_value() -> Foo {
23 11_u32
24 }
25
26 fn main() {
27 foo3(foo_value());
28 }