rust/tests/ui/traits/vtable/vtable-vacant.rs

32 lines
455 B
Rust
Raw Normal View History

2021-07-22 10:29:53 -05:00
// build-fail
#![feature(rustc_attrs)]
#![feature(negative_impls)]
#![allow(where_clauses_object_safety)]
2021-07-22 10:29:53 -05:00
// B --> A
#[rustc_dump_vtable]
trait A {
fn foo_a1(&self) {}
fn foo_a2(&self) where Self: Send {}
2021-07-22 10:29:53 -05:00
}
#[rustc_dump_vtable]
trait B: A {
2021-10-03 01:53:02 -05:00
//~^ error vtable
2021-07-22 10:29:53 -05:00
fn foo_b1(&self) {}
fn foo_b2(&self) where Self: Send {}
2021-07-22 10:29:53 -05:00
}
struct S;
impl !Send for S {}
2021-07-22 10:29:53 -05:00
impl A for S {}
impl B for S {}
fn foo(_: &dyn B) {}
fn main() {
foo(&S);
}