]> git.lizzy.rs Git - rust.git/blob - tests/ui/chalkify/impl_wf_2.rs
Rollup merge of #107101 - compiler-errors:perf-106309-1, r=petrochenkov
[rust.git] / tests / ui / chalkify / impl_wf_2.rs
1 // Split out of impl_wf.rs to work around rust aborting compilation early
2
3 // compile-flags: -Z trait-solver=chalk
4
5 trait Foo: Sized { }
6
7 trait Bar {
8     type Item: Foo;
9 }
10
11 impl Foo for i32 { }
12
13 // Implicit `T: Sized` bound.
14 impl<T> Foo for Option<T> { }
15
16 impl Bar for () {
17     type Item = i32;
18 }
19
20 impl<T> Bar for Option<T> {
21     type Item = Option<T>;
22 }
23
24 impl Bar for f32 {
25     type Item = f32;
26     //~^ ERROR the trait bound `f32: Foo` is not satisfied
27 }
28
29 trait Baz<U: ?Sized> where U: Foo { }
30
31 impl Baz<i32> for i32 { }
32
33 fn main() {}