]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/issues/issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs
Merge commit 'd3a2366ee877075c59b38bd8ced55f224fc7ef51' into sync_cg_clif-2022-07-26
[rust.git] / src / test / ui / impl-trait / issues / issue-57979-deeply-nested-impl-trait-in-assoc-proj.rs
1 // rust-lang/rust#57979 : the initial support for `impl Trait` didn't
2 // properly check syntax hidden behind an associated type projection,
3 // but it did catch *some cases*. This is checking that we continue to
4 // properly emit errors for those.
5 //
6 // issue-57979-nested-impl-trait-in-assoc-proj.rs shows the main case
7 // that we were previously failing to catch.
8
9 struct Deeper<T>(T);
10
11 pub trait Foo<T> { }
12 pub trait Bar { }
13 pub trait Quux { type Assoc; }
14 pub fn demo(_: impl Quux<Assoc=Deeper<impl Foo<impl Bar>>>) { }
15 //~^ ERROR nested `impl Trait` is not allowed
16
17 fn main() { }