about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates/parser/test_data
AgeCommit message (Collapse)AuthorLines
2025-08-14feat: hint at unterminated strings in unknown prefix errorsRalf Anton Beier-0/+20
When encountering 'unknown literal prefix' errors, check for unbalanced quotes in recent code and suggest checking for unterminated string literals.
2025-08-13Merge Trait and TraitAlias handlingDeadbeef-3/+3
2025-08-10parser: fix parsing of trait bound polarity and for-bindersNathaniel McCallum-13/+68
The rustc AST allows both `for<>` binders and `?` polarity modifiers in trait bounds, but they are parsed in a specific order and validated for correctness: 1. `for<>` binder is parsed first. 2. Polarity modifiers (`?`, `!`) are parsed second. 3. The parser validates that binders and polarity modifiers do not conflict: ```rust if let Some(binder_span) = binder_span { match modifiers.polarity { BoundPolarity::Maybe(polarity_span) => { // Error: "for<...> binder not allowed with ? polarity" } } } ``` This implies: - `for<> ?Sized` → Valid syntax. Invalid semantics. - `?for<> Sized` → Invalid syntax. However, rust-analyzer incorrectly had special-case logic that allowed `?for<>` as valid syntax. This fix removes that incorrect special case, making rust-analyzer reject `?for<> Sized` as a syntax error, matching rustc behavior. This has caused confusion in other crates (such as syn) which rely on these files to implement correct syntax evaluation.
2025-07-22Parse `for<'a> [const]`Chayim Refael Friedman-192/+306
And also refactor parsing of HRTB.
2025-07-09Make `global_asm!()` workChayim Refael Friedman-10/+22
Because apparently, we were not accepting inline asm in item position, completely breaking it.
2025-07-09Differentiate between `asm!()`, `global_asm!()` and `naked_asm!()`, and make ↵Chayim Refael Friedman-0/+56
only `asm!()` unsafe
2025-06-26Parse new const trait syntaxLukas Wirth-2/+3
2025-06-05Better parser recovery for macro calls in type bound positionLukas Wirth-0/+117
2025-06-04Give path segment type anchors their own grammar ruleLukas Wirth-128/+139
2025-05-30Update expected test outputArthur Baars-21/+60
2025-05-30Run 'cargo codegen' to update testsArthur Baars-0/+5
2025-05-15Improve asm supportChayim Refael Friedman-0/+42
Including: - Infer `label {}` and `const` operands. - Correctly handle unsafe check inside `label {}`. - Fix an embarrassing parser typo that cause labels to never be part of the AST
2025-04-30fix: Improve parser recovery a bitLukas Wirth-8/+59
2025-04-22Merge pull request #19657 from ChayimFriedman2/better-offset-ofLukas Wirth-0/+49
feat: Better support `offset_of!()`
2025-04-21Merge pull request #19643 from ChayimFriedman2/generic-const-itemsLukas Wirth-0/+270
feat: Parse generic consts
2025-04-21feat: parse `super let`Lukas Wirth-1/+24
2025-04-21Allow wrapping `builtin#offset_of` fields argument in parenthesesChayim Refael Friedman-0/+49
This is necessary to correctly handle nested fields (`foo.bar`), see the comments in the code for explanation.
2025-04-21Parse generic constsChayim Refael Friedman-0/+270
A lang team experiment, https://github.com/rust-lang/rust/issues/113521.
2025-03-25feat: parse `unsafe` record fieldsLukas Wirth-1/+15
2025-03-17chore: Bump `Edition::CURRENT` to 2024Lukas Wirth-4/+12
2025-02-23Fix codegen of parser inline tests runnerniller-g-4/+4
When running `cargo codegen` the `crates/parser/test_data/generated/runner.rs` file is only updated when some file in `crates/parser/test_data/inline` changes. However this is not sufficient in all cases
2025-01-27feat: Implement `default-field-values`Shoyu Vanilla-14/+253
2025-01-17Merge pull request #18908 from jnyfah/error-bracesLukas Wirth-0/+612
Fix: Detect missing errors for } braces before else in let...else statements
2025-01-16CRLF to LFjnyfah-100/+115
2025-01-16added testsjnyfah-0/+597
2025-01-16feat: complete raw, const keywordlh123-0/+20
2024-12-20Fix a case where completion was unable to expand a macroChayim Refael Friedman-39/+45
Which caused the macros of the popular `tracing` crate to not offer completions. The reason is rather complicated: it boils down to macro ignoring their input and completion always choosing the first expansion.
2024-12-06Merge pull request #18625 from Veykril/push-npnxwpxuzlqzLukas Wirth-0/+57
fix: Fix parser getting stuck for bad asm expressions
2024-12-06fix: Fix parser getting stuck for bad asm expressionsLukas Wirth-0/+57
2024-12-05fix: Fix parsing of dyn T in generic arg on 2015 editionLukas Wirth-1/+63
2024-12-05Parse lifetime bounds in lifetime param into TypeBoundListLukas Wirth-33/+56
This mainly aids in error recovery but also makes it a bit easier to handle lifetime resolution. While doing so it also came apparent that we were not actually lowering lifetime outlives relationships within lifetime parameter declaration bounds, so this fixes that.
2024-12-05fix: Fix parsing of integer/keyword name refs in various placesLukas Wirth-49/+237
2024-12-04Fix parsing of parenthesized type args and RTNLukas Wirth-555/+821
2024-12-04fix: Don't create empty path nodesLukas Wirth-9/+2
2024-12-04Better parser recovery for incomplete attributesLukas Wirth-6/+103
2024-10-31Parse patterns with leading pipe properly in all placesChayim Refael Friedman-0/+59
2024-10-30Only parse `safe` as contextual kw in extern blocksChayim Refael Friedman-0/+35
I don't like the party of `bool`s that is becoming, but two isn't worth a refactoring yet IMO.
2024-10-27Merge pull request #18419 from ChayimFriedman2/leading-orLukas Wirth-24/+28
fix: Put leading `|` in patterns under `OrPat`
2024-10-27Put leading `|` in patterns under `OrPat`Chayim Refael Friedman-24/+28
Previously it was one level above, and that caused problems with macros that expand to it, because macros expect to get only one top-level node.
2024-10-27Correctly handle `#""` in edition <2024Chayim Refael Friedman-0/+7
2024-10-22fix: Fix incorrect parsing of use boundsLukas Wirth-8/+10
Also lower them a bit more
2024-10-20feat: initial support for safe_kw in extern blocksroife-0/+225
2024-10-01fix: correctly parse `use` in generic parametersSabrinaJewson-0/+28
2024-09-05asm! parsing and lowering fixesLukas Wirth-7/+9
2024-09-05Give InlineAsmOperand a HIR representationLukas Wirth-25/+27
2024-09-05Add Definition kind for asm register operandLukas Wirth-16/+20
2024-09-04Parse builtin#asm expressionsLukas Wirth-2/+91
2024-08-26Fix Return Type Syntax to include `..` (i.e. `method(..)` and not ↵Chayim Refael Friedman-5/+114
`method()`) as specified in the RFC
2024-07-23fix: move `use` parsing to outer match armwinstxnhdw-12/+13
2024-07-23chore: update codegenswinstxnhdw-0/+73