summaryrefslogtreecommitdiffstats
path: root/src/test/ui/traits/vtable/vtable-vacant.rs
blob: a64796358345f9629860e7659c439c2dfe9cff27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// build-fail
#![feature(rustc_attrs)]
#![feature(negative_impls)]
#![allow(where_clauses_object_safety)]

// B --> A

#[rustc_dump_vtable]
trait A {
    fn foo_a1(&self) {}
    fn foo_a2(&self) where Self: Send {}
}

#[rustc_dump_vtable]
trait B: A {
    //~^ error vtable
    fn foo_b1(&self) {}
    fn foo_b2(&self) where Self: Send {}
}

struct S;
impl !Send for S {}

impl A for S {}
impl B for S {}

fn foo(_: &dyn B) {}

fn main() {
    foo(&S);
}