2019-03-11 10:30:40 -05:00
|
|
|
// 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
|
2019-08-03 14:59:22 -05:00
|
|
|
// properly emit errors for those.
|
2019-03-11 10:30:40 -05:00
|
|
|
//
|
|
|
|
// issue-57979-nested-impl-trait-in-assoc-proj.rs shows the main case
|
|
|
|
// that we were previously failing to catch.
|
|
|
|
|
|
|
|
struct Deeper<T>(T);
|
|
|
|
|
2019-08-03 14:59:22 -05:00
|
|
|
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
|
2019-03-11 10:30:40 -05:00
|
|
|
|
|
|
|
fn main() { }
|