]> git.lizzy.rs Git - rust.git/blob - src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr
Rollup merge of #64192 - estebank:turbofish-madness, r=petrochenkov
[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:22:9
33    |
34 LL | fn baz() -> impl std::fmt::Display {
35    |             ---------------------- expected because this return type...
36 LL |     if false {
37 LL |         return 0i32;
38    |                ---- ...is found to be `i32` here
39 LL |     } else {
40 LL |         1u32
41    |         ^^^^ expected i32, found u32
42    |
43    = note: expected type `i32`
44               found type `u32`
45
46 error[E0308]: if and else have incompatible types
47   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:31:9
48    |
49 LL | /     if false {
50 LL | |         0i32
51    | |         ---- expected because of this
52 LL | |     } else {
53 LL | |         1u32
54    | |         ^^^^ expected i32, found u32
55 LL | |
56 LL | |     }
57    | |_____- if and else have incompatible types
58    |
59    = note: expected type `i32`
60               found type `u32`
61
62 error[E0308]: mismatched types
63   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:39:14
64    |
65 LL | fn bat() -> impl std::fmt::Display {
66    |             ---------------------- expected because this return type...
67 LL |     match 13 {
68 LL |         0 => return 0i32,
69    |                     ---- ...is found to be `i32` here
70 LL |         _ => 1u32,
71    |              ^^^^ expected i32, found u32
72    |
73    = note: expected type `i32`
74               found type `u32`
75
76 error[E0308]: mismatched types
77   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:45:5
78    |
79 LL |   fn can() -> impl std::fmt::Display {
80    |               ---------------------- expected because this return type...
81 LL | /     match 13 {
82 LL | |
83 LL | |         0 => return 0i32,
84    | |                     ---- ...is found to be `i32` here
85 LL | |         1 => 1u32,
86 LL | |         _ => 2u32,
87 LL | |     }
88    | |_____^ expected i32, found u32
89    |
90    = note: expected type `i32`
91               found type `u32`
92
93 error[E0308]: mismatched types
94   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:59:13
95    |
96 LL | fn cat() -> impl std::fmt::Display {
97    |             ---------------------- expected because this return type...
98 ...
99 LL |             return 0i32;
100    |                    ---- ...is found to be `i32` here
101 ...
102 LL |             1u32
103    |             ^^^^ expected i32, found u32
104    |
105    = note: expected type `i32`
106               found type `u32`
107
108 error: aborting due to 7 previous errors
109
110 For more information about this error, try `rustc --explain E0308`.