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, even with the new
5 // future-incompatibility warnings.
7 // issue-57979-nested-impl-trait-in-assoc-proj.rs shows the main case
8 // that we were previously failing to catch.
13 #![allow(nested_impl_trait)]
17 pub trait Quux { type Assoc; }
18 pub fn demo(_: impl Quux<Assoc=super::Deeper<impl Foo<impl Bar>>>) { }
19 //~^ ERROR nested `impl Trait` is not allowed
23 #![warn(nested_impl_trait)]
27 pub trait Quux { type Assoc; }
28 pub fn demo(_: impl Quux<Assoc=super::Deeper<impl Foo<impl Bar>>>) { }
29 //~^ ERROR nested `impl Trait` is not allowed
33 #![deny(nested_impl_trait)]
37 pub trait Quux { type Assoc; }
38 pub fn demo(_: impl Quux<Assoc=super::Deeper<impl Foo<impl Bar>>>) { }
39 //~^ ERROR nested `impl Trait` is not allowed