]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/associated-types-normalize-in-bounds-binding.rs
feat(rustdoc): open sidebar menu when links inside it are focused
[rust.git] / src / test / ui / associated-types / associated-types-normalize-in-bounds-binding.rs
1 // run-pass
2 #![allow(unused_variables)]
3 // Test that we normalize associated types that appear in a bound that
4 // contains a binding. Issue #21664.
5
6 // pretty-expanded FIXME #23616
7
8 #![allow(dead_code)]
9
10 pub trait Integral {
11     type Opposite;
12 }
13
14 impl Integral for i32 {
15     type Opposite = u32;
16 }
17
18 impl Integral for u32 {
19     type Opposite = i32;
20 }
21
22 pub trait FnLike<A> {
23     type R;
24
25     fn dummy(&self, a: A) -> Self::R { loop { } }
26 }
27
28 fn foo<T>()
29     where T : FnLike<<i32 as Integral>::Opposite, R=bool>
30 {
31     bar::<T>();
32 }
33
34 fn bar<T>()
35     where T : FnLike<u32, R=bool>
36 {}
37
38 fn main() { }