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 `()` ``` |
||
---|---|---|
.. | ||
liveness-assign | ||
liveness-closure-require-ret.rs | ||
liveness-closure-require-ret.stderr | ||
liveness-dead.rs | ||
liveness-dead.stderr | ||
liveness-forgot-ret.rs | ||
liveness-forgot-ret.stderr | ||
liveness-issue-2163.rs | ||
liveness-issue-2163.stderr | ||
liveness-missing-ret2.rs | ||
liveness-missing-ret2.stderr | ||
liveness-move-call-arg.nll.stderr | ||
liveness-move-call-arg.rs | ||
liveness-move-call-arg.stderr | ||
liveness-move-in-loop.nll.stderr | ||
liveness-move-in-loop.rs | ||
liveness-move-in-loop.stderr | ||
liveness-move-in-while.nll.stderr | ||
liveness-move-in-while.rs | ||
liveness-move-in-while.stderr | ||
liveness-return-last-stmt-semi.rs | ||
liveness-return-last-stmt-semi.stderr | ||
liveness-unused.rs | ||
liveness-unused.stderr | ||
liveness-use-after-move.nll.stderr | ||
liveness-use-after-move.rs | ||
liveness-use-after-move.stderr | ||
liveness-use-after-send.nll.stderr | ||
liveness-use-after-send.rs | ||
liveness-use-after-send.stderr |