summaryrefslogtreecommitdiffstats
path: root/tests/ui/chalkify/super_trait.rs
blob: 540ae51e57f6d80c2a7819da256f460ca8cd0672 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// 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>()
}