Commit graph

147 commits

Author SHA1 Message Date
Chayim Refael Friedman
c7ceb39f67 Parse for<'a> [const]
And also refactor parsing of HRTB.
2025-07-22 16:24:42 +03:00
Chayim Refael Friedman
95c04c4503 Make global_asm!() work
Because apparently, we were not accepting inline asm in item position, completely breaking it.
2025-07-09 18:55:27 +03:00
Chayim Refael Friedman
bd8087e86e Differentiate between asm!(), global_asm!() and naked_asm!(), and make only asm!() unsafe 2025-07-09 17:37:27 +03:00
Lukas Wirth
5924b38e3d Parse new const trait syntax 2025-06-26 11:08:30 +02:00
Lukas Wirth
5d3001795a Better parser recovery for macro calls in type bound position 2025-06-05 16:11:30 +02:00
Lukas Wirth
7c3de05e3a Give path segment type anchors their own grammar rule 2025-06-04 11:40:05 +02:00
Arthur Baars
55328ba9b4 Update expected test output 2025-05-30 21:16:38 +00:00
Arthur Baars
a91b67e682 Run 'cargo codegen' to update tests 2025-05-30 21:05:12 +00:00
Chayim Refael Friedman
5ed11234cc Improve asm support
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-05-15 23:36:00 +03:00
Lukas Wirth
e0dca847ad fix: Improve parser recovery a bit 2025-04-30 16:40:01 +02:00
Lukas Wirth
1c68d83569
Merge pull request #19657 from ChayimFriedman2/better-offset-of
feat: Better support `offset_of!()`
2025-04-22 13:28:34 +00:00
Lukas Wirth
e3f7d18458
Merge pull request #19643 from ChayimFriedman2/generic-const-items
feat: Parse generic consts
2025-04-21 12:17:08 +00:00
Lukas Wirth
1b6948e88a feat: parse super let 2025-04-21 13:47:42 +02:00
Chayim Refael Friedman
db6db2aacc Allow wrapping builtin#offset_of fields argument in parentheses
This is necessary to correctly handle nested fields (`foo.bar`), see the comments in the code for explanation.
2025-04-21 03:43:15 +03:00
Chayim Refael Friedman
812a035689 Parse generic consts
A lang team experiment, https://github.com/rust-lang/rust/issues/113521.
2025-04-21 02:11:56 +03:00
Lukas Wirth
452e2ca031 feat: parse unsafe record fields 2025-03-25 08:55:31 +01:00
Lukas Wirth
a505420751 chore: Bump Edition::CURRENT to 2024 2025-03-17 12:29:19 +01:00
niller-g
18d6e281b3 Fix codegen of parser inline tests runner
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-02-23 11:41:34 +01:00
Shoyu Vanilla
7de0b2e75a feat: Implement default-field-values 2025-01-27 19:38:35 +09:00
Lukas Wirth
cd199eacd0
Merge pull request #18908 from jnyfah/error-braces
Fix: Detect missing errors for } braces before else in let...else statements
2025-01-17 13:29:56 +00:00
jnyfah
31c07e4676 CRLF to LF 2025-01-16 16:46:06 +01:00
jnyfah
b96819ca44 added tests 2025-01-16 16:19:47 +01:00
lh123
9809143562 feat: complete raw, const keyword 2025-01-16 18:27:59 +08:00
Chayim Refael Friedman
02d47f3a81 Fix a case where completion was unable to expand a macro
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-20 13:14:59 +02:00
Lukas Wirth
cddaf7485f
Merge pull request #18625 from Veykril/push-npnxwpxuzlqz
fix: Fix parser getting stuck for bad asm expressions
2024-12-06 05:11:08 +00:00
Lukas Wirth
4a24e729b0 fix: Fix parser getting stuck for bad asm expressions 2024-12-06 05:57:00 +01:00
Lukas Wirth
a049941c1a fix: Fix parsing of dyn T in generic arg on 2015 edition 2024-12-05 20:26:49 +01:00
Lukas Wirth
f3d7415bd6 Parse lifetime bounds in lifetime param into TypeBoundList
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-05 17:52:02 +01:00
Lukas Wirth
df7ab62a06 fix: Fix parsing of integer/keyword name refs in various places 2024-12-05 15:27:50 +01:00
Lukas Wirth
65c0b29720 Fix parsing of parenthesized type args and RTN 2024-12-04 11:48:47 +01:00
Lukas Wirth
caba872f88 fix: Don't create empty path nodes 2024-12-04 07:01:45 +01:00
Lukas Wirth
b6fc9c14ac Better parser recovery for incomplete attributes 2024-12-04 06:45:59 +01:00
Chayim Refael Friedman
210ead8454 Parse patterns with leading pipe properly in all places 2024-10-31 15:32:37 +02:00
Chayim Refael Friedman
3a8dc27e72 Only parse safe as contextual kw in extern blocks
I don't like the party of `bool`s that is becoming, but two isn't worth a refactoring yet IMO.
2024-10-30 19:28:33 +02:00
Lukas Wirth
3b3a87fe9b
Merge pull request #18419 from ChayimFriedman2/leading-or
fix: Put leading `|` in patterns under `OrPat`
2024-10-27 11:25:16 +00:00
Chayim Refael Friedman
e12a001b55 Put leading | in patterns under OrPat
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-27 13:11:38 +02:00
Chayim Refael Friedman
3b3beaab31 Correctly handle #"" in edition <2024 2024-10-27 00:47:13 +03:00
Lukas Wirth
95298a2e61 fix: Fix incorrect parsing of use bounds
Also lower them a bit more
2024-10-22 13:34:26 +02:00
roife
9f1e450c4f feat: initial support for safe_kw in extern blocks 2024-10-20 17:12:52 +08:00
SabrinaJewson
e735906839
fix: correctly parse use in generic parameters 2024-10-01 22:10:47 +01:00
Lukas Wirth
f74a0c8801 asm! parsing and lowering fixes 2024-09-05 15:08:16 +02:00
Lukas Wirth
811905fce8 Give InlineAsmOperand a HIR representation 2024-09-05 12:40:48 +02:00
Lukas Wirth
a600e1df73 Add Definition kind for asm register operand 2024-09-05 10:53:07 +02:00
Lukas Wirth
86658c66b4 Parse builtin#asm expressions 2024-09-04 14:09:03 +02:00
Chayim Refael Friedman
21e6058ab7 Fix Return Type Syntax to include .. (i.e. method(..) and not method()) as specified in the RFC 2024-08-26 01:45:52 +03:00
winstxnhdw
4a91453409 fix: move use parsing to outer match arm 2024-07-23 22:36:46 +01:00
winstxnhdw
e4941c0c73 chore: update codegens 2024-07-23 22:36:46 +01:00
Lukas Wirth
41603ab14e Add missing dyn parse special cases in 2015 edition 2024-07-20 09:18:40 +02:00
Lukas Wirth
f4199f786e Parse contextual dyn keyword properly in edition 2015 2024-07-19 20:20:30 +02:00
Lukas Wirth
d235d09bf9 Parse try as a keyword only in edition 2018 and up 2024-07-19 15:43:20 +02:00