2020-03-03 10:25:03 -06:00
|
|
|
// run-pass
|
2023-01-02 17:18:00 -06:00
|
|
|
// compile-flags: -Z trait-solver=chalk
|
2020-03-03 10:25:03 -06:00
|
|
|
|
|
|
|
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>()
|
|
|
|
}
|