2021-07-22 10:29:53 -05:00
|
|
|
// build-fail
|
|
|
|
#![feature(rustc_attrs)]
|
2021-08-31 18:49:14 -05:00
|
|
|
#![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) {}
|
2021-08-31 18:49:14 -05:00
|
|
|
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) {}
|
2021-08-31 18:49:14 -05:00
|
|
|
fn foo_b2(&self) where Self: Send {}
|
2021-07-22 10:29:53 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
struct S;
|
2021-08-31 18:49:14 -05:00
|
|
|
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);
|
|
|
|
}
|