]> git.proxmox.com Git - rustc.git/blame - src/test/ui/traits/inheritance/auto-xc.rs
Merge tag 'debian/1.52.1+dfsg1-1_exp2' into proxmox/buster
[rustc.git] / src / test / ui / traits / inheritance / auto-xc.rs
CommitLineData
b7449926 1// run-pass
0bf4aa26 2#![allow(dead_code)]
6a06907d 3// aux-build:auto_xc.rs
223e47cc 4
c34b1796 5
6a06907d 6extern crate auto_xc as aux;
223e47cc
LB
7
8use aux::{Foo, Bar, Baz, Quux};
9
c34b1796 10struct A { x: isize }
223e47cc 11
c34b1796
AL
12impl Foo for A { fn f(&self) -> isize { 10 } }
13impl Bar for A { fn g(&self) -> isize { 20 } }
14impl Baz for A { fn h(&self) -> isize { 30 } }
223e47cc
LB
15
16fn f<T:Quux>(a: &T) {
970d7e83
LB
17 assert_eq!(a.f(), 10);
18 assert_eq!(a.g(), 20);
19 assert_eq!(a.h(), 30);
223e47cc
LB
20}
21
22pub fn main() {
23 let a = &A { x: 3 };
24 f(a);
25}