about summary refs log tree commit diff
path: root/tests/ui/traits/trait-upcasting/multiple-supertraits-modulo-normalization-vtable.rs
blob: 6b9ddf9bedcd56394c56a3bcb20f1cf1e53a1901 (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
32
33
34
35
36
#![feature(rustc_attrs)]

// Test for <https://github.com/rust-lang/rust/issues/135315>.

trait Supertrait<T> {
    fn _print_numbers(&self, mem: &[usize; 100]) {
        println!("{mem:?}");
    }
}
impl<T> Supertrait<T> for () {}

trait Identity {
    type Selff;
}
impl<Selff> Identity for Selff {
    type Selff = Selff;
}

trait Middle<T>: Supertrait<()> + Supertrait<T> {
    fn say_hello(&self, _: &usize) {
        println!("Hello!");
    }
}
impl<T> Middle<T> for () {}

trait Trait: Middle<<() as Identity>::Selff> {}

#[rustc_dump_vtable]
impl Trait for () {}
//~^ ERROR vtable entries

#[rustc_dump_vtable]
type Virtual = dyn Middle<()>;
//~^ ERROR vtable entries

fn main() {}