// run-pass // Test that we correctly normalize the type of a struct field // which has an associated type. pub trait UnifyKey { type Value; fn dummy(&self) { } } pub struct Node { pub key: K, pub value: K::Value, } fn foo>,V : Clone>(node: &Node) -> Option { node.value.clone() } impl UnifyKey for i32 { type Value = Option; } impl UnifyKey for u32 { type Value = Option; } pub fn main() { let node: Node = Node { key: 1, value: Some(22) }; assert_eq!(foo(&node), Some(22)); let node: Node = Node { key: 1, value: Some(22) }; assert_eq!(foo(&node), Some(22)); }