LL | }
LL | 1u32
| ^^^^ expected i32, found u32
- |
- = note: expected type `i32`
- found type `u32`
error[E0308]: mismatched types
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:13:16
LL | } else {
LL | return 1u32;
| ^^^^ expected i32, found u32
- |
- = note: expected type `i32`
- found type `u32`
error[E0308]: mismatched types
- --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:19:5
+ --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:22:9
|
-LL | fn baz() -> impl std::fmt::Display {
- | ---------------------- expected because this return type...
-LL | / if false {
-LL | |
-LL | | return 0i32;
- | | ---- ...is found to be `i32` here
-LL | | } else {
-LL | | 1u32
-LL | | }
- | |_____^ expected i32, found u32
- |
- = note: expected type `i32`
- found type `u32`
+LL | fn baz() -> impl std::fmt::Display {
+ | ---------------------- expected because this return type...
+LL | if false {
+LL | return 0i32;
+ | ---- ...is found to be `i32` here
+LL | } else {
+LL | 1u32
+ | ^^^^ expected i32, found u32
error[E0308]: if and else have incompatible types
--> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:31:9
LL | |
LL | | }
| |_____- if and else have incompatible types
+
+error[E0308]: mismatched types
+ --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:39:14
+ |
+LL | fn bat() -> impl std::fmt::Display {
+ | ---------------------- expected because this return type...
+LL | match 13 {
+LL | 0 => return 0i32,
+ | ---- ...is found to be `i32` here
+LL | _ => 1u32,
+ | ^^^^ expected i32, found u32
+
+error[E0308]: mismatched types
+ --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:45:5
+ |
+LL | fn can() -> impl std::fmt::Display {
+ | ---------------------- expected because this return type...
+LL | / match 13 {
+LL | |
+LL | | 0 => return 0i32,
+ | | ---- ...is found to be `i32` here
+LL | | 1 => 1u32,
+LL | | _ => 2u32,
+LL | | }
+ | |_____^ expected i32, found u32
+
+error[E0308]: mismatched types
+ --> $DIR/point-to-type-err-cause-on-impl-trait-return.rs:59:13
|
- = note: expected type `i32`
- found type `u32`
+LL | fn cat() -> impl std::fmt::Display {
+ | ---------------------- expected because this return type...
+...
+LL | return 0i32;
+ | ---- ...is found to be `i32` here
+...
+LL | 1u32
+ | ^^^^ expected i32, found u32
-error: aborting due to 4 previous errors
+error: aborting due to 7 previous errors
For more information about this error, try `rustc --explain E0308`.