about summary refs log tree commit diff
path: root/src/test/codegen/stack-alloc-string-slice.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-09-26 02:56:03 -0700
committerbors <bors@rust-lang.org>2013-09-26 02:56:03 -0700
commita8a69ec15dce8bed5827d02e92cdb9fe2857b829 (patch)
tree983b168964d34754854dbefdff38e62943bdeb05 /src/test/codegen/stack-alloc-string-slice.rs
parenta268a1c4bb3867e4f8b050e07fd216e561b50521 (diff)
parent56d415aa60b41e171890cb76a323cb95d617b077 (diff)
downloadrust-a8a69ec15dce8bed5827d02e92cdb9fe2857b829.tar.gz
rust-a8a69ec15dce8bed5827d02e92cdb9fe2857b829.zip
auto merge of #9464 : bmaxa/rust/master, r=cmr
I have tried this fix and it seems to work either with single or multiple trait inheritance.

trait Base:Base2 + Base3{
fn foo(&self);
}

trait Base2 {
fn baz(&self);
}

trait Base3{
fn root(&self);
}

trait Super: Base{
fn bar(&self);
}

struct X;

impl Base for X {
fn foo(&self) {
println("base foo");
}

}
impl Base2 for X {
fn baz(&self) {
println("base2 baz");
}

}
impl Base3 for X {
fn root(&self) {
println("base3 root");
}

}
impl Super for X {
fn bar(&self) {
println("super bar");
}
}

fn main() {
let n = X;
let s = &n as &Super;
s.bar();
s.foo(); // super bar
s.baz();
s.root();
}

bmaxa@maxa:~/examples/rust$ rustc error.rs
bmaxa@maxa:~/examples/rust$ ./error 
super bar
base foo
base2 baz
base3 root
Diffstat (limited to 'src/test/codegen/stack-alloc-string-slice.rs')
0 files changed, 0 insertions, 0 deletions