about summary refs log tree commit diff
path: root/src/test/ui/expr/malformed_closure
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-100/+0
2022-12-30Suppress errors due to TypeError not coercing with inference variablesMichael Goulet-24/+3
2022-12-13Avoid rendering empty annotationsOli Scherer-3/+0
2022-12-13Make some diagnostics not depend on the source of what they reference being ↵Oli Scherer-3/+3
available
2022-12-11Use `with_forced_trimmed_paths`Esteban Küber-1/+1
2022-09-09Be careful about expr_ty_adjusted when noting block tail typeMichael Goulet-1/+1
2021-12-17Bless ui testsDeadbeef-2/+2
2021-11-20Point at source of trait bound obligations in more placesEsteban Kuber-0/+5
Be more thorough in using `ItemObligation` and `BindingObligation` when evaluating obligations so that we can point at trait bounds that introduced unfulfilled obligations. We no longer incorrectly point at unrelated trait bounds (`substs-ppaux.verbose.stderr`). In particular, we now point at trait bounds on method calls. We no longer point at "obvious" obligation sources (we no longer have a note pointing at `Trait` saying "required by a bound in `Trait`", like in `associated-types-no-suitable-supertrait*`). Address part of #89418.
2021-09-16Fix rebaseEsteban Kuber-3/+12
2021-09-09Emit proper errors on missing closure bracesSasha Pourcelot-0/+110
This commit focuses on emitting clean errors for the following syntax error: ``` Some(42).map(|a| dbg!(a); a ); ``` Previous implementation tried to recover after parsing the closure body (the `dbg` expression) by replacing the next `;` with a `,`, which made the next expression belong to the next function argument. As such, the following errors were emitted (among others): - the semicolon token was not expected, - a is not in scope, - Option::map is supposed to take one argument, not two. This commit allows us to gracefully handle this situation by adding giving the parser the ability to remember when it has just parsed a closure body inside a function call. When this happens, we can treat the unexpected `;` specifically and try to parse as much statements as possible in order to eat the whole block. When we can't parse statements anymore, we generate a clean error indicating that the braces are missing, and return an ExprKind::Err.