]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/equality.stderr
7bb2d7d47a51d01a75b02a701096d53006078dc3
[rust.git] / src / test / ui / impl-trait / equality.stderr
1 error[E0308]: mismatched types
2   --> $DIR/equality.rs:15:5
3    |
4 LL | fn two(x: bool) -> impl Foo {
5    |                    -------- expected because this return type...
6 LL |     if x {
7 LL |         return 1_i32;
8    |                ----- ...is found to be `i32` here
9 LL |     }
10 LL |     0_u32
11    |     ^^^^^ expected i32, found u32
12    |
13    = note: expected type `i32`
14               found type `u32`
15
16 error[E0277]: cannot add `impl Foo` to `u32`
17   --> $DIR/equality.rs:24:11
18    |
19 LL |         n + sum_to(n - 1)
20    |           ^ no implementation for `u32 + impl Foo`
21    |
22    = help: the trait `std::ops::Add<impl Foo>` is not implemented for `u32`
23
24 error: aborting due to 2 previous errors
25
26 Some errors have detailed explanations: E0277, E0308.
27 For more information about an error, try `rustc --explain E0277`.