3 #![allow(non_camel_case_types)]
4 #![allow(non_snake_case)]
7 fn read(&self) -> isize;
10 trait connection_factory<C:connection> {
11 fn create(&self) -> C;
14 type my_connection = ();
15 type my_connection_factory = ();
17 impl connection for () {
18 fn read(&self) -> isize { 43 }
21 impl connection_factory<my_connection> for my_connection_factory {
22 fn create(&self) -> my_connection { () }
27 let connection = factory.create();
28 let result = connection.read();
29 assert_eq!(result, 43);