From e82b0cde4ef5c8f7dfd451eb8ea1c57d4c153bf8 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Tue, 22 Feb 2022 17:20:58 +0000 Subject: Add a test showing that a similar example compiles --- src/test/ui/impl-trait/nested-return-type3.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/test/ui/impl-trait/nested-return-type3.rs (limited to 'src') diff --git a/src/test/ui/impl-trait/nested-return-type3.rs b/src/test/ui/impl-trait/nested-return-type3.rs new file mode 100644 index 00000000000..74b4dae22eb --- /dev/null +++ b/src/test/ui/impl-trait/nested-return-type3.rs @@ -0,0 +1,20 @@ +// check-pass + +trait Duh {} + +impl Duh for i32 {} + +trait Trait { + type Assoc: Duh; +} + +impl Trait for F { + type Assoc = F; +} + +fn foo() -> impl Trait { + 42 +} + +fn main() { +} -- cgit 1.4.1-3-g733a5