about summary refs log tree commit diff
path: root/src/test/ui/if
AgeCommit message (Collapse)AuthorLines
2019-03-21Auto merge of #58981 - estebank:elseless-if, r=davidtwcobors-1/+80
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-11Update testsVadim Petrochenkov-25/+25
2019-03-07Add more details to elseless if errorEsteban Küber-2/+51
2019-03-07address review commentsEsteban Küber-6/+8
2019-03-07Point at coercion reason for if exprs without else clauseEsteban Küber-0/+28
``` 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 `()` ```
2019-02-07Reweork incompatible match arms errorEsteban Küber-19/+12
- Point at the body expression of the match arm with the type error. - Point at the prior match arms explicitely stating the evaluated type. - Point at the entire match expr in a secondary span, instead of primary. - For type errors in the first match arm, the cause is outside of the match, treat as implicit block error to give a more appropriate error.
2019-01-13Tweak output of type mismatch between "then" and `else` `if` armsEsteban Küber-2/+4
2019-01-12Stabilise irrefutable if-let and while-let patternsvarkor-33/+58
This stabilises RFC 2086 (https://github.com/rust-lang/rust/issues/44495). Co-Authored-By: Sebastian Malton <sebastian@malton.name>
2018-12-31Improve type mismatch error messagesYuning Zhang-3/+3
Replace "integral variable" with "integer" and replace "floating-point variable" with "floating-point number" to make the message less confusing.
2018-12-26Add span label to unused string formatting argumentEsteban Küber-12/+14
Fix #55350.
2018-12-26Various changes to string format diagnosticsEsteban Küber-1/+7
- Point at opening mismatched formatting brace - Account for differences between raw and regular strings - Account for differences between the code snippet and `InternedString` - Add more tests
2018-12-25Remove licensesMark Rousskov-155/+45
2018-11-07Removed `#[rustc_error]` from tests that are all `// compile-pass`.Felix S. Klock II-12/+4
I also added `// skip-codegen` to each one, to address potential concerns that this change would otherwise slow down our test suite spending time generating code for files that are really just meant to be checks of compiler diagnostics. (However, I will say: My preference is to not use `// skip-codegen` if one can avoid it. We can use all the testing of how we drive LLVM that we can get...) (Updated post rebase.)
2018-10-28Use token description in "expected/found" parse messagesEsteban Küber-1/+2
2018-10-03remove padding from multiline format string labelAndy Russell-1/+21
Fixes #53836.
2018-08-14Merged migrated compile-fail tests and ui tests. Fixes #46841.David Wood-0/+648