rust/tests/ui/object-safety/call-when-assoc-ty-is-sized.rs
2023-12-14 15:22:37 +01:00

26 lines
318 B
Rust

// check-pass
// revisions: current next
//[next] compile-flags: -Znext-solver
trait Foo {
type Bar<'a>
where
Self: Sized;
fn test(&self);
}
impl Foo for () {
type Bar<'a> = () where Self: Sized;
fn test(&self) {}
}
fn test(x: &dyn Foo) {
x.test();
}
fn main() {
test(&());
}