]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/run-pass/issues/issue-9394-inherited-trait-calls.rs
1 // Copyright 2012 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.
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.
13 trait Base
: Base2
+ Base3
{
14 fn foo(&self) -> String
;
15 fn foo1(&self) -> String
;
16 fn foo2(&self) -> String
{
17 "base foo2".to_string()
22 fn baz(&self) -> String
;
26 fn root(&self) -> String
;
30 fn bar(&self) -> String
;
36 fn foo(&self) -> String
{
37 "base foo".to_string()
39 fn foo1(&self) -> String
{
40 "base foo1".to_string()
46 fn baz(&self) -> String
{
47 "base2 baz".to_string()
52 fn root(&self) -> String
{
53 "base3 root".to_string()
58 fn bar(&self) -> String
{
59 "super bar".to_string()
66 assert_eq
!(s
.bar(),"super bar".to_string());
67 assert_eq
!(s
.foo(),"base foo".to_string());
68 assert_eq
!(s
.foo1(),"base foo1".to_string());
69 assert_eq
!(s
.foo2(),"base foo2".to_string());
70 assert_eq
!(s
.baz(),"base2 baz".to_string());
71 assert_eq
!(s
.root(),"base3 root".to_string());