about summary refs log tree commit diff
path: root/tests/ui/parser/issues
AgeCommit message (Collapse)AuthorLines
2023-09-12Only suggest turbofish in patterns if we may recoverLeón Orell Valerian Liehr-0/+21
2023-09-06Add explanatory note to 'expected item' errorGurinder Singh-0/+19
2023-08-15Clean up some bad ui testing annotationsMichael Goulet-3/+8
2023-08-07relocate tests to pass tidydarklyspaced-0/+15
2023-08-03Rollup merge of #114300 - MU001999:fix/turbofish-pat, r=estebankMatthias Krüger-6/+16
Suggests turbofish in patterns Fixes #114112 r? ```@estebank```
2023-08-01Suggests turbofish in patternsMu001999-6/+16
2023-07-31parser: more friendly hints for handling `async move` in the 2015 editionbohan-0/+12
2023-06-27Rollup merge of #112518 - chenyukang:yukang-fix-112458, r=davidtwcoMatthias Krüger-0/+19
Detect actual span for getting unexpected token from parsing macros Fixes #112458
2023-06-11Detect actual span for getting unexpected token from parsing macrosyukang-0/+19
2023-06-10reword the message to suggest surrounding with parenthesesyukang-4/+4
2023-06-10take care module name for suggesting surround the struct literal in parenthesesyukang-0/+78
2023-05-27Rollup merge of #111181 - bvanjoi:fix-issue-111148, r=davidtwcoMatthias Krüger-0/+10
fix(parse): return unpected when current token is EOF close https://github.com/rust-lang/rust/issues/111148 #111148 panic occurred because [FatalError.raise()](https://github.com/bvanjoi/rust/blob/master/compiler/rustc_parse/src/parser/mod.rs#LL540C3-L540C3) was encountered which caused by `Eof` and `Pound`(the last token) had same span, when parsing `#` in `fn a<<i<Y<w<>#`. <img width="825" alt="image" src="https://user-images.githubusercontent.com/30187863/236612589-9e2c6a0b-18cd-408c-b636-c12a51cbcf1c.png"> There are a few ways to solve this problem: - Change the action assign for [self.last_unexpected_token_span](https://github.com/rust-lang/rust/blob/master/compiler/rustc_parse/src/parser/diagnostics.rs#L592), for example, if current token is `Eof`, then return Error directly. - Avoid triggering the `FatalError` when the current token is `Eof`. I have chosen the second option because executing `expected_one_of_not_found` when the token is `Eof` but not in `ediable` seems reasonable.
2023-05-13fmtyukang-2/+1
2023-05-13Fix ice caused by shorthand fields in NoFieldsForFnCallyukang-0/+22
2023-05-13fix(parse): return unpected when current token is EOFbohan-0/+10
2023-05-02Implement negative boundsMichael Goulet-48/+61
2023-05-02Auto merge of #109128 - chenyukang:yukang/remove-type-ascription, r=estebankbors-296/+164
Remove type ascription from parser and diagnostics Mostly based on https://github.com/rust-lang/rust/pull/106826 Part of #101728 r? `@estebank`
2023-05-01Rip it outNilstrieb-296/+164
My type ascription Oh rip it out Ah If you think we live too much then You can sacrifice diagnostics Don't mix your garbage Into my syntax So many weird hacks keep diagnostics alive Yet I don't even step outside So many bad diagnostics keep tyasc alive Yet tyasc doesn't even bother to survive!
2023-04-28fixup tests wrt new normalizationMaybe Waffle-1/+1
2023-04-07fix: fix regression in #109203Ezra Shaw-0/+22
2023-04-03remove invalid ignore-prettyPietro Albini-1/+0
2023-03-20feat: implement error recovery in `expected_ident_found`Ezra Shaw-33/+38
2023-03-19refactor: improve "ident starts with number" errorEzra Shaw-3/+15
2023-03-12Remove uses of `box_syntax` in rustc and toolsclubby789-4/+10
2023-03-09feat/refactor: improve errors in case of ident with number at startEzra Shaw-9/+15
2023-03-05add test for https://github.com/rust-lang/rust/issues/108242Lukas Markeffsky-0/+18
2023-03-01Add testcase for issue 105209yukang-0/+25
2023-03-01Fix #104367, add test case for mismatched open/close delimsyukang-0/+32
2023-02-28remove duplicated diagnostic for unclosed delimiteryukang-160/+46
2023-02-28Exit when there are unmatched delims to avoid noisy diagnosticsyukang-520/+108
2023-02-03Rollup merge of #107602 - estebank:anon-enum-access, r=compiler-errorsMatthias Krüger-27/+55
Parse and recover from type ascription in patterns Reintroduce part of #106960, which was reverted in #107478. r? `@compiler-errors`
2023-02-02Parse and recover from type ascription in patternsEsteban Küber-27/+55
2023-02-02Rollup merge of #106919 - compiler-errors:underscore-typo-in-field-pat, ↵Matthias Krüger-1/+6
r=jackh726 Recover `_` as `..` in field pattern
2023-02-02Recover _ as .. in field patternMichael Goulet-1/+6
2023-02-02Revert "Teach parser to understand fake anonymous enum syntax" and related ↵Michael Goulet-55/+27
commits Revert "review comment: Remove AST AnonTy" This reverts commit 020cca8d36cb678e3ddc2ead41364be314d19e93. Revert "Ensure macros are not affected" This reverts commit 12d18e403139eeeeb339e8611b2bed4910864edb. Revert "Emit fewer errors on patterns with possible type ascription" This reverts commit c847a01a3b1f620c4fdb98c75805033e768975d1. Revert "Teach parser to understand fake anonymous enum syntax" This reverts commit 2d824206655bfb26cb5eed43490ee396542b153e.
2023-01-30Modify primary span label for E0308Esteban Küber-1/+1
The previous output was unintuitive to users.
2023-01-28Auto merge of #107408 - matthiaskrgr:rollup-b5vz2ow, r=matthiaskrgrbors-9/+29
Rollup of 9 pull requests Successful merges: - #104012 (Improve unexpected close and mismatch delimiter hint in TokenTreesReader) - #104252 (Stabilize the const_socketaddr feature) - #105524 (Replace libc::{type} with crate::ffi::{type}) - #107096 (Detect references to non-existant messages in Fluent resources) - #107355 (Add regression test for #60755) - #107384 (Remove `BOOL_TY_FOR_UNIT_TESTING`) - #107385 (Use `FallibleTypeFolder` for `ConstInferUnifier` not `TypeRelation`) - #107391 (rustdoc: remove inline javascript from copy-path button) - #107398 (Remove `ControlFlow::{BREAK, CONTINUE}`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-01-28Rollup merge of #104012 - chenyukang:yukang/fix-103882-deli-indentation, ↵Matthias Krüger-9/+29
r=petrochenkov Improve unexpected close and mismatch delimiter hint in TokenTreesReader Fixes #103882 Fixes #68987 Fixes #69259 The inner indentation mismatching will be covered by outer block, the new added function `report_error_prone_delim_block` will find out the error prone candidates for reporting.
2023-01-28Auto merge of #106916 - lukas-code:overlapping-substs, r=estebankbors-2/+2
Remove overlapping parts of multipart suggestions This PR adds a debug assertion that the parts of a single substitution cannot overlap, fixes a overlapping substitution from the testsuite, and fixes https://github.com/rust-lang/rust/issues/106870. Note that a single suggestion can still have multiple overlapping substitutions / possible edits, we just don't suggest overlapping replacements in a single edit anymore. I've also included a fix for an unrelated bug where rustfix for `explicit_outlives_requirements` would produce multiple trailing commas for a where clause.
2023-01-27Improve unexpected close and mismatch delimiter hint in TokenTreesReaderyukang-14/+18
2023-01-26add testcase for #104012yukang-0/+16
2023-01-20preserve delim spans during `macro_rules!` expansion if ableLukas Markeffsky-2/+2
2023-01-17Emit fewer errors on patterns with possible type ascriptionEsteban Küber-10/+2
2023-01-17Teach parser to understand fake anonymous enum syntaxEsteban Küber-18/+54
Parse `-> Ty | OtherTy`. Parse type ascription in top level patterns.
2023-01-14Rollup merge of #106566 - clubby789:contiguous-weird-unicode, r=cjgillotMatthias Krüger-0/+0
Emit a single error for contiguous sequences of unknown tokens Closes #106101 On encountering a sequence of identical source characters which are unknown tokens, note the amount of subsequent characters and advance past them silently. The old behavior was to emit an error and 'help' note for every single one. `@rustbot` label +A-diagnostics +A-parser
2023-01-12Emit a single error for contiguous sequences of Unicode homoglyphsclubby789-0/+0
2023-01-11parser: recover from where clauses placed before tuple struct bodiesLeón Orell Valerian Liehr-4/+15
2023-01-11Move /src/test to /testsAlbert Larsan-0/+6304