]>
git.proxmox.com Git - rustc.git/blob - tests/ui/associated-types/associated-types-struct-field-numbered.rs
2 // Test that we correctly normalize the type of a struct field
3 // which has an associated type.
12 pub struct Node
<K
:UnifyKey
>(#[allow(unused_tuple_struct_fields)] K, K::Value);
14 fn foo
<K
: UnifyKey
<Value
=Option
<V
>>,V
: Clone
>(node
: &Node
<K
>) -> Option
<V
> {
18 impl UnifyKey
for i32 {
19 type Value
= Option
<u32>;
22 impl UnifyKey
for u32 {
23 type Value
= Option
<i32>;
27 let node
: Node
<i32> = Node(1, Some(22));
28 assert_eq
!(foo(&node
), Some(22));
30 let node
: Node
<u32> = Node(1, Some(22));
31 assert_eq
!(foo(&node
), Some(22));