1
Fork 0
rust/tests/ui/traits/trait-upcasting/multiple-supertraits-modulo-normalization-vtable.rs

38 lines
719 B
Rust
Raw Normal View History

2025-01-10 20:09:10 +00:00
#![feature(rustc_attrs)]
#![feature(trait_upcasting)]
// Test for <https://github.com/rust-lang/rust/issues/135315>.
2025-01-10 20:09:10 +00:00
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() {}