]> git.lizzy.rs Git - rust.git/blob - src/test/ui/point-to-type-err-cause-on-impl-trait-return.stderr
Rollup merge of #67909 - varkor:obsolete-const-print, r=davidtwco
[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 error[E0308]: mismatched types
14   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:13:16
15    |
16 LL | fn bar() -> impl std::fmt::Display {
17    |             ---------------------- expected because this return type...
18 LL |     if false {
19 LL |         return 0i32;
20    |                ---- ...is found to be `i32` here
21 LL |     } else {
22 LL |         return 1u32;
23    |                ^^^^ expected `i32`, found `u32`
24
25 error[E0308]: mismatched types
26   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:22:9
27    |
28 LL | fn baz() -> impl std::fmt::Display {
29    |             ---------------------- expected because this return type...
30 LL |     if false {
31 LL |         return 0i32;
32    |                ---- ...is found to be `i32` here
33 LL |     } else {
34 LL |         1u32
35    |         ^^^^ expected `i32`, found `u32`
36
37 error[E0308]: `if` and `else` have incompatible types
38   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:31:9
39    |
40 LL | /     if false {
41 LL | |         0i32
42    | |         ---- expected because of this
43 LL | |     } else {
44 LL | |         1u32
45    | |         ^^^^ expected `i32`, found `u32`
46 LL | |
47 LL | |     }
48    | |_____- `if` and `else` have incompatible types
49
50 error[E0308]: mismatched types
51   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:39:14
52    |
53 LL | fn bat() -> impl std::fmt::Display {
54    |             ---------------------- expected because this return type...
55 LL |     match 13 {
56 LL |         0 => return 0i32,
57    |                     ---- ...is found to be `i32` here
58 LL |         _ => 1u32,
59    |              ^^^^ expected `i32`, found `u32`
60
61 error[E0308]: mismatched types
62   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:45:5
63    |
64 LL |   fn can() -> impl std::fmt::Display {
65    |               ---------------------- expected because this return type...
66 LL | /     match 13 {
67 LL | |
68 LL | |         0 => return 0i32,
69    | |                     ---- ...is found to be `i32` here
70 LL | |         1 => 1u32,
71 LL | |         _ => 2u32,
72 LL | |     }
73    | |_____^ expected `i32`, found `u32`
74
75 error[E0308]: mismatched types
76   --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:59:13
77    |
78 LL | fn cat() -> impl std::fmt::Display {
79    |             ---------------------- expected because this return type...
80 ...
81 LL |             return 0i32;
82    |                    ---- ...is found to be `i32` here
83 ...
84 LL |             1u32
85    |             ^^^^ expected `i32`, found `u32`
86
87 error: aborting due to 7 previous errors
88
89 For more information about this error, try `rustc --explain E0308`.