rust/tests/ui/object-safety/call-when-assoc-ty-is-sized.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
324 B
Rust
Raw Normal View History

// check-pass
// revisions: current next
//[next] compile-flags: -Ztrait-solver=next
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(&());
}