2021-07-17 02:44:19 -05:00
|
|
|
// build-fail
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
|
|
|
|
#[rustc_dump_vtable]
|
|
|
|
trait A {
|
|
|
|
fn foo_a(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rustc_dump_vtable]
|
|
|
|
trait B {
|
2021-07-18 04:23:37 -05:00
|
|
|
//~^ error Vtable
|
2021-07-17 02:44:19 -05:00
|
|
|
fn foo_b(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rustc_dump_vtable]
|
|
|
|
trait C: A + B {
|
2021-07-18 04:23:37 -05:00
|
|
|
//~^ error Vtable
|
2021-07-17 02:44:19 -05:00
|
|
|
fn foo_c(&self) {}
|
|
|
|
}
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
impl A for S {}
|
|
|
|
impl B for S {}
|
|
|
|
impl C for S {}
|
|
|
|
|
|
|
|
fn foo(c: &dyn C) {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
foo(&S);
|
|
|
|
}
|