]>
Commit | Line | Data |
---|---|---|
b7449926 | 1 | // run-pass |
223e47cc LB |
2 | // aux-build:trait_inheritance_auto_xc_2_aux.rs |
3 | ||
c34b1796 AL |
4 | |
5 | extern crate trait_inheritance_auto_xc_2_aux as aux; | |
223e47cc LB |
6 | |
7 | // aux defines impls of Foo, Bar and Baz for A | |
8 | use aux::{Foo, Bar, Baz, A}; | |
9 | ||
10 | // We want to extend all Foo, Bar, Bazes to Quuxes | |
11 | pub trait Quux: Foo + Bar + Baz { } | |
12 | impl<T:Foo + Bar + Baz> Quux for T { } | |
13 | ||
14 | fn f<T:Quux>(a: &T) { | |
970d7e83 LB |
15 | assert_eq!(a.f(), 10); |
16 | assert_eq!(a.g(), 20); | |
17 | assert_eq!(a.h(), 30); | |
223e47cc LB |
18 | } |
19 | ||
20 | pub fn main() { | |
21 | let a = &A { x: 3 }; | |
22 | f(a); | |
23 | } |