rust/src/test/ui/coercion
bors ad9068f874 Auto merge of #57230 - estebank:return-mismatch, r=varkor
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 `()`
```
2019-01-05 22:25:47 +00:00
..
coerce-expect-unsized-ascribed.rs Remove licenses 2018-12-25 21:08:33 -07:00
coerce-expect-unsized-ascribed.stderr Remove licenses 2018-12-25 21:08:33 -07:00
coerce-issue-49593-box-never.rs Remove licenses 2018-12-25 21:08:33 -07:00
coerce-mut.rs Remove licenses 2018-12-25 21:08:33 -07:00
coerce-mut.stderr Remove licenses 2018-12-25 21:08:33 -07:00
coerce-overloaded-autoderef.ast.nll.stderr Remove licenses 2018-12-25 21:08:33 -07:00
coerce-overloaded-autoderef.ast.stderr Remove licenses 2018-12-25 21:08:33 -07:00
coerce-overloaded-autoderef.mir.nll.stderr Remove licenses 2018-12-25 21:08:33 -07:00
coerce-overloaded-autoderef.mir.stderr Remove licenses 2018-12-25 21:08:33 -07:00
coerce-overloaded-autoderef.rs Remove licenses 2018-12-25 21:08:33 -07:00
coerce-to-bang-cast.rs Remove licenses 2018-12-25 21:08:33 -07:00
coerce-to-bang-cast.stderr Remove licenses 2018-12-25 21:08:33 -07:00
coerce-to-bang.rs Remove licenses 2018-12-25 21:08:33 -07:00
coerce-to-bang.stderr Improve type mismatch error messages 2018-12-31 20:43:08 -05:00
coercion-missing-tail-expected-type.rs Remove licenses 2018-12-25 21:08:33 -07:00
coercion-missing-tail-expected-type.stderr Tweak E0308 error for clarity 2018-12-30 21:59:27 -08:00
coercion-slice.rs Remove licenses 2018-12-25 21:08:33 -07:00
coercion-slice.stderr Remove licenses 2018-12-25 21:08:33 -07:00