]> git.proxmox.com Git - rustc.git/blame - src/test/run-pass/trait-default-method-xc-2.rs
Imported Upstream version 1.0.0~beta.3
[rustc.git] / src / test / run-pass / trait-default-method-xc-2.rs
CommitLineData
1a4d82fc
JJ
1// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2// file at the top-level directory of this distribution and at
3// http://rust-lang.org/COPYRIGHT.
4//
5// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8// option. This file may not be copied, modified, or distributed
9// except according to those terms.
10
11// aux-build:trait_default_method_xc_aux.rs
12// aux-build:trait_default_method_xc_aux_2.rs
13
14
c34b1796
AL
15
16extern crate trait_default_method_xc_aux as aux;
17extern crate trait_default_method_xc_aux_2 as aux2;
1a4d82fc
JJ
18use aux::A;
19use aux2::{a_struct, welp};
20
21
22pub fn main () {
23
85aaf69f
SL
24 let a = a_struct { x: 0 };
25 let b = a_struct { x: 1 };
1a4d82fc 26
85aaf69f 27 assert_eq!(0.g(), 10);
1a4d82fc
JJ
28 assert_eq!(a.g(), 10);
29 assert_eq!(a.h(), 11);
30 assert_eq!(b.g(), 10);
31 assert_eq!(b.h(), 11);
32 assert_eq!(A::lurr(&a, &b), 21);
33
85aaf69f 34 welp(&0);
1a4d82fc 35}