rust/tests/ui/chalkify/super_trait.rs
2023-01-11 09:32:08 +00:00

20 lines
304 B
Rust

// run-pass
// compile-flags: -Z trait-solver=chalk
trait Foo { }
trait Bar: Foo { }
impl Foo for i32 { }
impl Bar for i32 { }
fn only_foo<T: Foo>() { }
fn only_bar<T: Bar>() {
// `T` implements `Bar` hence `T` must also implement `Foo`
only_foo::<T>()
}
fn main() {
only_bar::<i32>()
}