From 593fd7c6b152d69d553f756d975993fe7e054f11 Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Fri, 20 Aug 2021 11:15:48 -0300 Subject: [PATCH] test TAIT in different positions --- .../type-alias-impl-trait-tuple.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.rs b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.rs index 86c9d482143..1f2d0e47ea3 100644 --- a/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.rs +++ b/src/test/ui/type-alias-impl-trait/type-alias-impl-trait-tuple.rs @@ -7,20 +7,19 @@ pub trait MyTrait {} impl MyTrait for bool {} +type Foo = impl MyTrait; + struct Blah { my_foo: Foo, - my_u8: u8 + my_u8: u8, } impl Blah { fn new() -> Blah { - Blah { - my_foo: make_foo(), - my_u8: 12 - } + Blah { my_foo: make_foo(), my_u8: 12 } } - fn into_inner(self) -> (Foo, u8) { - (self.my_foo, self.my_u8) + fn into_inner(self) -> (Foo, u8, Foo) { + (self.my_foo, self.my_u8, make_foo()) } } @@ -28,6 +27,4 @@ fn make_foo() -> Foo { true } -type Foo = impl MyTrait; - fn main() {}