]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-61311-normalize.rs
Rollup merge of #103146 - joboet:cleanup_pthread_condvar, r=Mark-Simulacrum
[rust.git] / src / test / ui / nll / issue-61311-normalize.rs
1 // Regression test for #61311
2 // We would ICE after failing to normalize `Self::Proj` in the `impl` below.
3
4 // check-pass
5
6 pub struct Unit;
7 trait Obj {}
8
9 trait Bound {}
10 impl Bound for Unit {}
11
12 pub trait HasProj {
13     type Proj;
14 }
15
16 impl<T> HasProj for T {
17     type Proj = Unit;
18 }
19
20 trait HasProjFn {
21     type Proj;
22     fn the_fn(_: Self::Proj);
23 }
24
25 impl HasProjFn for Unit
26 where
27     Box<dyn Obj + 'static>: HasProj,
28     <Box<dyn Obj + 'static> as HasProj>::Proj: Bound,
29 {
30     type Proj = Unit;
31     fn the_fn(_: Self::Proj) {}
32 }
33
34 fn main() {}