diff options
Diffstat (limited to 'tests/ui/feature-gates/feature-gate-type_alias_impl_trait.rs')
-rw-r--r-- | tests/ui/feature-gates/feature-gate-type_alias_impl_trait.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/ui/feature-gates/feature-gate-type_alias_impl_trait.rs b/tests/ui/feature-gates/feature-gate-type_alias_impl_trait.rs new file mode 100644 index 000000000..6dfd7f684 --- /dev/null +++ b/tests/ui/feature-gates/feature-gate-type_alias_impl_trait.rs @@ -0,0 +1,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() {} |