ad9068f874
Modify mismatched type error for functions with no return Fix #50009. ``` error[E0308]: mismatched types --> $DIR/coercion-missing-tail-expected-type.rs:3:24 | LL | fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types | -------- ^^^ expected i32, found () | | | this function's body doesn't return LL | x + 1; | - help: consider removing this semicolon | = note: expected type `i32` found type `()` ``` instead of ``` error[E0308]: mismatched types --> $DIR/coercion-missing-tail-expected-type.rs:3:28 | LL | fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types | ____________________________^ LL | | x + 1; | | - help: consider removing this semicolon LL | | } | |_^ expected i32, found () | = note: expected type `i32` found type `()` ``` |
||
---|---|---|
.. | ||
coerce-expect-unsized-ascribed.rs | ||
coerce-expect-unsized-ascribed.stderr | ||
coerce-issue-49593-box-never.rs | ||
coerce-mut.rs | ||
coerce-mut.stderr | ||
coerce-overloaded-autoderef.ast.nll.stderr | ||
coerce-overloaded-autoderef.ast.stderr | ||
coerce-overloaded-autoderef.mir.nll.stderr | ||
coerce-overloaded-autoderef.mir.stderr | ||
coerce-overloaded-autoderef.rs | ||
coerce-to-bang-cast.rs | ||
coerce-to-bang-cast.stderr | ||
coerce-to-bang.rs | ||
coerce-to-bang.stderr | ||
coercion-missing-tail-expected-type.rs | ||
coercion-missing-tail-expected-type.stderr | ||
coercion-slice.rs | ||
coercion-slice.stderr |