]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/associated-types/associated-types-bound.rs
2 // Test equality constrai32s on associated types in a where clause.
6 fn to_i32(&self) -> i32;
10 fn to_i32(&self) -> i32 { *self }
14 fn to_i32(&self) -> i32 { *self as i32 }
21 fn get(&self) -> <Self as GetToI32
>::R
;
24 impl GetToI32
for i32 {
26 fn get(&self) -> i32 { *self }
29 impl GetToI32
for u32 {
31 fn get(&self) -> u32 { *self }
34 fn foo
<G
>(g
: G
) -> i32
37 ToI32
::to_i32(&g
.get())
41 assert_eq
!(foo(22i32), 22);
42 assert_eq
!(foo(22u32), 22);