]> git.lizzy.rs Git - rust.git/blob - src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr
Auto merge of #62748 - luca-barbieri:optimize-refcell-borrow, r=RalfJung
[rust.git] / src / test / ui / point-to-type-err-cause-on-impl-trait-return.stderr
1 error[E0308]: mismatched types
2   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:5:5
3    |
4 LL | fn foo() -> impl std::fmt::Display {
5    |             ---------------------- expected because this return type...
6 LL |     if false {
7 LL |         return 0i32;
8    |                ---- ...is found to be `i32` here
9 LL |     }
10 LL |     1u32
11    |     ^^^^ expected i32, found u32
12    |
13    = note: expected type `i32`
14               found type `u32`
15
16 error[E0308]: mismatched types
17   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:13:16
18    |
19 LL | fn bar() -> impl std::fmt::Display {
20    |             ---------------------- expected because this return type...
21 LL |     if false {
22 LL |         return 0i32;
23    |                ---- ...is found to be `i32` here
24 LL |     } else {
25 LL |         return 1u32;
26    |                ^^^^ expected i32, found u32
27    |
28    = note: expected type `i32`
29               found type `u32`
30
31 error[E0308]: mismatched types
32   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:19:5
33    |
34 LL |   fn baz() -> impl std::fmt::Display {
35    |               ---------------------- expected because this return type...
36 LL | /     if false {
37 LL | |
38 LL | |         return 0i32;
39    | |                ---- ...is found to be `i32` here
40 LL | |     } else {
41 LL | |         1u32
42 LL | |     }
43    | |_____^ expected i32, found u32
44    |
45    = note: expected type `i32`
46               found type `u32`
47
48 error[E0308]: if and else have incompatible types
49   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:31:9
50    |
51 LL | /     if false {
52 LL | |         0i32
53    | |         ---- expected because of this
54 LL | |     } else {
55 LL | |         1u32
56    | |         ^^^^ expected i32, found u32
57 LL | |
58 LL | |     }
59    | |_____- if and else have incompatible types
60    |
61    = note: expected type `i32`
62               found type `u32`
63
64 error: aborting due to 4 previous errors
65
66 For more information about this error, try `rustc --explain E0308`.