summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs')
-rw-r--r--tests/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs b/tests/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs
new file mode 100644
index 000000000..0daec3305
--- /dev/null
+++ b/tests/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs
@@ -0,0 +1,17 @@
+// rust-lang/rust#57979 : the initial support for `impl Trait` didn't
+// properly check syntax hidden behind an associated type projection,
+// but it did catch *some cases*. This is checking that we continue to
+// properly emit errors for those.
+//
+// issue-57979-nested-impl-trait-in-assoc-proj.rs shows the main case
+// that we were previously failing to catch.
+
+struct Deeper<T>(T);
+
+pub trait Foo<T> { }
+pub trait Bar { }
+pub trait Quux { type Assoc; }
+pub fn demo(_: impl Quux<Assoc=Deeper<impl Foo<impl Bar>>>) { }
+//~^ ERROR nested `impl Trait` is not allowed
+
+fn main() { }