]> git.lizzy.rs Git - rust.git/blob - tests/ui/chalkify/super_trait.rs
Auto merge of #101138 - Rejyr:diagnostic-migration-rustc-lint-pt2, r=davidtwco
[rust.git] / tests / ui / chalkify / super_trait.rs
1 // run-pass
2 // compile-flags: -Z trait-solver=chalk
3
4 trait Foo { }
5 trait Bar: Foo { }
6
7 impl Foo for i32 { }
8 impl Bar for i32 { }
9
10 fn only_foo<T: Foo>() { }
11
12 fn only_bar<T: Bar>() {
13     // `T` implements `Bar` hence `T` must also implement `Foo`
14     only_foo::<T>()
15 }
16
17 fn main() {
18     only_bar::<i32>()
19 }