]> git.lizzy.rs Git - rust.git/blob - tests/ui/chalkify/type_wf.rs
Rollup merge of #106605 - notriddle:notriddle/outdated-rustbook, r=GuillaumeGomez
[rust.git] / tests / ui / chalkify / type_wf.rs
1 // check-fail
2 // compile-flags: -Z trait-solver=chalk
3
4 trait Foo { }
5
6 struct S<T: Foo> {
7     x: T,
8 }
9
10 impl Foo for i32 { }
11 impl<T> Foo for Option<T> { }
12
13 fn main() {
14     let s = S {
15        x: 5,
16     };
17
18     let s = S {
19         x: 5.0, //~ ERROR the trait bound `{float}: Foo` is not satisfied
20     };
21
22     let s = S {
23         x: Some(5.0),
24     };
25 }