]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/argument-types.rs
Rollup merge of #104965 - zacklukem:p-option-as_ref-docs, r=scottmcm
[rust.git] / tests / ui / type-alias-impl-trait / argument-types.rs
1 #![feature(type_alias_impl_trait)]
2 #![allow(dead_code)]
3 // check-pass
4 use std::fmt::Debug;
5
6 type Foo = impl Debug;
7
8 fn foo1(mut x: Foo) {
9     x = 22_u32;
10 }
11
12 fn foo2(mut x: Foo) {
13     // no constraint on x
14 }
15
16 fn foo3(x: Foo) {
17     println!("{:?}", x);
18 }
19
20 fn foo_value() -> Foo {
21     11_u32
22 }
23
24 fn main() {
25     foo3(foo_value());
26 }