// 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(#[allow(unused_tuple_struct_fields)] K, K::Value); fn foo>,V : Clone>(node: &Node) -> Option { node.1.clone() } impl UnifyKey for i32 { type Value = Option; } impl UnifyKey for u32 { type Value = Option; } pub fn main() { let node: Node = Node(1, Some(22)); assert_eq!(foo(&node), Some(22)); let node: Node = Node(1, Some(22)); assert_eq!(foo(&node), Some(22)); }