]> git.proxmox.com Git - rustc.git/blob - src/test/ui/impl-trait/issues/issue-57979-impl-trait-in-path.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / impl-trait / issues / issue-57979-impl-trait-in-path.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 // Here we test behavior of occurrences of `impl Trait` within a path
4 // component in that context.
5
6 pub trait Bar { }
7 pub trait Quux<T> { type Assoc; }
8 pub fn demo(_: impl Quux<(), Assoc=<() as Quux<impl Bar>>::Assoc>) { }
9 //~^ ERROR `impl Trait` is not allowed in path parameters
10 impl<T> Quux<T> for () { type Assoc = u32; }
11
12 fn main() { }