about summary refs log tree commit diff
path: root/src/test/ui/if/if-without-else-as-fn-expr.rs
AgeCommit message (Collapse)AuthorLines
2020-11-24Move src/test/ui/if to src/test/ui/expr/ifHavvy (Ryan Scheel)-49/+0
2020-01-05Add backticks to various diagnosticsvarkor-6/+6
2019-08-31Emit a single error on if expr with expectation and no else clauseEsteban Küber-6/+0
2019-05-10Various test changesMazdak Farrokhzad-0/+30
2019-03-07Add more details to elseless if errorEsteban Küber-0/+15
2019-03-07Point at coercion reason for if exprs without else clauseEsteban Küber-0/+10
``` 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 `()` ```