about summary refs log tree commit diff
path: root/src/test/ui/expr/if
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-1124/+0
2022-10-07Rollup merge of #102720 - lyming2007:issue-102397-fix, r=compiler-errorsMatthias Krüger-4/+4
do not reverse the expected type and found type for ObligationCauseCo… …de of IfExpressionWithNoElse this will fix #102397
2022-10-06Rollup merge of #102708 - TaKO8Ki:improve-eqeq-suggestion, r=estebankMatthias Krüger-0/+5
Suggest `==` to wrong assign expr Given the following code: ```rust fn main() { let x = 3; let y = 3; if x == x && y = y { println!("{}", x); } } ``` Current output is: ``` error[E0308]: mismatched types --> src/main.rs:4:18 | 4 | if x == x && y = y { | ^ expected `bool`, found integer error[E0308]: mismatched types --> src/main.rs:4:8 | 4 | if x == x && y = y { | ^^^^^^^^^^^^^^^ expected `bool`, found `()` ``` This adds a suggestion: ```diff error[E0308]: mismatched types --> src/main.rs:6:18 | 6 | if x == x && y = y { | ^ expected `bool`, found integer error[E0308]: mismatched types --> src/main.rs:6:8 | 6 | if x == x && y = y { | ^^^^^^^^^^^^^^^ expected `bool`, found `()` | + help: you might have meant to compare for equality + | + 6 | if x == x && y == y { + | + ``` And this fixes a part of #97469
2022-10-05do not reverse the expected type and found type for ObligationCauseCode of ↵Yiming Lei-4/+4
IfExpressionWithNoElse this will fix #102397
2022-10-05suggest `==` to the rest of assign exprTakayuki Maeda-0/+5
2022-10-01bless ui testsMaybe Waffle-1/+1
2022-08-29Revert let_chains stabilizationNilstrieb-6/+18
This reverts commit 326646074940222d602f3683d0559088690830f4. This is the revert against master, the beta revert was already done in #100538.
2022-08-04Resolve vars before emitting coerce errorMichael Goulet-0/+15
2022-07-19Mention first and last macro in backtraceMichael Goulet-1/+1
2022-07-16Stabilize `let_chains`Caio-18/+6
2022-06-16diagnostics: fix trailing spaceklensy-4/+4
2022-06-13Improve parsing errors and suggestions for bad if statementsMichael Goulet-12/+7
2022-06-07Don't suggest adding let in certain if conditionsMichael Goulet-0/+93
2022-01-18Formally implement let chainsCaio-12/+1
2021-12-01Improve diagnostic for missing half of binary operator in `if` conditionFabian Wolff-1/+5
2021-11-14Move some tests to more reasonable directoriesCaio-0/+52
2021-10-15Bless testsCameron Steffen-2/+2
2021-08-15Introduce hir::ExprKind::Let - Take 2Caio-34/+20
2021-08-11Modify structured suggestion outputEsteban Küber-12/+16
* On suggestions that include deletions, use a diff inspired output format * When suggesting addition, use `+` as underline * Color highlight modified span
2021-07-30Use multispan suggestions more oftenEsteban Küber-32/+48
* Use more accurate span for `async move` suggestion * Use more accurate span for deref suggestion * Use `multipart_suggestion` more often
2021-05-12Show macro name in 'this error originates in macro' messageAaron Hill-2/+2
When there are multiple macros in use, it can be difficult to tell which one was responsible for producing an error.
2021-02-18Add explanations and suggestions to `irrefutable_let_patterns` lintCamelid-0/+16
2021-02-18Rollup merge of #82215 - TaKO8Ki:replace-if-let-while-let, r=varkorDylan DPC-16/+16
Replace if-let and while-let with `if let` and `while let` This pull request replaces if-let and while-let with `if let` and `while let`. closes https://github.com/rust-lang/rust/issues/82205
2021-02-17replace if-let and while-let with `if let` and `while let`Takayuki Maeda-16/+16
2021-02-16Move some tests to more reasonable directoriesCaio-0/+45
2020-12-04Move format machinery tests to where they belongAleksey Kladov-486/+0
2020-11-24Move src/test/ui/if-*.rs to src/test/expr/if/if-*.rsHavvy (Ryan Scheel)-0/+189
2020-11-24Move src/test/ui/if-attrs to src/test/ui/expr/if/attrsHavvy (Ryan Scheel)-0/+176
2020-11-24Move src/test/ui/if to src/test/ui/expr/ifHavvy (Ryan Scheel)-0/+1025