rust/src/test/ui/if
bors 86466a397a Auto merge of #58981 - estebank:elseless-if, r=davidtwco
Point at coercion reason for `if` expressions without else clause if caused by return type

```
error[E0317]: if may be missing an else clause
  --> $DIR/if-without-else-as-fn-expr.rs:2:5
   |
LL |   fn foo(bar: usize) -> usize {
   |                         ----- found `usize` because of this return type
LL | /     if bar % 5 == 0 {
LL | |         return 3;
LL | |     }
   | |_____^ expected (), found usize
   |
   = note: expected type `()`
              found type `usize`
   = note: `if` expressions without `else` must evaluate to `()`
```

Fix #25228.
2019-03-21 23:42:41 +00:00
..
if-branch-types.rs Remove licenses 2018-12-25 21:08:33 -07:00
if-branch-types.stderr Tweak output of type mismatch between "then" and else if arms 2019-01-13 17:35:59 -08:00
if-let-arm-types.rs Reweork incompatible match arms error 2019-02-07 05:39:54 -08:00
if-let-arm-types.stderr Update tests 2019-03-11 23:10:26 +03:00
if-let.rs Stabilise irrefutable if-let and while-let patterns 2019-01-12 03:10:59 +00:00
if-let.stderr Update tests 2019-03-11 23:10:26 +03:00
if-loop.rs Remove licenses 2018-12-25 21:08:33 -07:00
if-typeck.rs Remove licenses 2018-12-25 21:08:33 -07:00
if-typeck.stderr Remove licenses 2018-12-25 21:08:33 -07:00
if-without-block.rs Remove licenses 2018-12-25 21:08:33 -07:00
if-without-block.stderr Remove licenses 2018-12-25 21:08:33 -07:00
if-without-else-as-fn-expr.rs Add more details to elseless if error 2019-03-07 14:37:18 -08:00
if-without-else-as-fn-expr.stderr Add more details to elseless if error 2019-03-07 14:37:18 -08:00
if-without-else-result.rs Remove licenses 2018-12-25 21:08:33 -07:00
if-without-else-result.stderr Add more details to elseless if error 2019-03-07 14:37:18 -08:00
ifmt-bad-arg.rs Remove licenses 2018-12-25 21:08:33 -07:00
ifmt-bad-arg.stderr Update tests 2019-03-11 23:10:26 +03:00
ifmt-bad-format-args.rs Remove licenses 2018-12-25 21:08:33 -07:00
ifmt-bad-format-args.stderr Update tests 2019-03-11 23:10:26 +03:00
ifmt-unimpl.rs Remove licenses 2018-12-25 21:08:33 -07:00
ifmt-unimpl.stderr Remove licenses 2018-12-25 21:08:33 -07:00
ifmt-unknown-trait.rs Remove licenses 2018-12-25 21:08:33 -07:00
ifmt-unknown-trait.stderr Remove licenses 2018-12-25 21:08:33 -07:00