summaryrefslogtreecommitdiffstats
path: root/tests/ui/impl-trait/issues/issue-57979-impl-trait-in-path.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/impl-trait/issues/issue-57979-impl-trait-in-path.rs')
-rw-r--r--tests/ui/impl-trait/issues/issue-57979-impl-trait-in-path.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/issues/issue-57979-impl-trait-in-path.rs b/tests/ui/impl-trait/issues/issue-57979-impl-trait-in-path.rs
new file mode 100644
index 000000000..c5ecd1caa
--- /dev/null
+++ b/tests/ui/impl-trait/issues/issue-57979-impl-trait-in-path.rs
@@ -0,0 +1,12 @@
+// rust-lang/rust#57979 : the initial support for `impl Trait` didn't
+// properly check syntax hidden behind an associated type projection.
+// Here we test behavior of occurrences of `impl Trait` within a path
+// component in that context.
+
+pub trait Bar { }
+pub trait Quux<T> { type Assoc; }
+pub fn demo(_: impl Quux<(), Assoc=<() as Quux<impl Bar>>::Assoc>) { }
+//~^ ERROR `impl Trait` is not allowed in path parameters
+impl<T> Quux<T> for () { type Assoc = u32; }
+
+fn main() { }