521 Commits

Author SHA1 Message Date
Laurențiu Nicola
ac8c057d87 Bump rustc crates 2025-05-20 10:03:14 +03:00
Laurențiu Nicola
9e86544698 Merge from rust-lang/rust 2025-05-20 10:01:00 +03: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
Stuart Cook
9f4e2cc51d
Rollup merge of #140035 - fee1-dead-contrib:push-oszwkkvmpkks, r=jieyouxu,wesleywiser
Implement RFC 3503: frontmatters

Tracking issue: #136889

Supercedes #137193. This implements [RFC 3503](https://github.com/rust-lang/rfcs/blob/master/text/3503-frontmatter.md).

This might break rust-analyzer. Will look into how to fix that.

Suggestions welcome for how to improve diagnostics.
2025-05-06 16:28:39 +10:00
Deadbeef
9fce1dfac5 Implement RFC 3503: frontmatters
Supercedes #137193
2025-05-05 23:10:08 +08:00
Lukas Wirth
e0dca847ad fix: Improve parser recovery a bit 2025-04-30 16:40:01 +02:00
Laurențiu Nicola
1f727edb2d Format code 2025-04-28 11:11:47 +03:00
Laurențiu Nicola
6225bb9c44 Merge from rust-lang/rust 2025-04-28 11:06:53 +03:00
Chayim Refael Friedman
8bff414abc Preallocate parser::Input 2025-04-25 17:18:14 +03: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
Guillaume Gomez
2135a01cbe Clean up rustc-literal-escaper usage in rust-analyzer 2025-04-05 20:06:52 +02:00
Guillaume Gomez
80cb724b3b Update rustc-literal-escaper version to 0.0.2 2025-04-04 22:26:10 +02:00
Guillaume Gomez
f2ac210f0c Remove usage of rustc_lexer::unescape in rust-analyzer 2025-04-04 14:59:14 +02:00
Lukas Wirth
452e2ca031 feat: parse unsafe record fields 2025-03-25 08:55:31 +01:00
Lukas Wirth
500ea05aef chore: Bump dependencies 2025-03-23 08:46:10 +01:00
Lukas Wirth
3d9ac497aa fix: Fix incorrect expansion of builtin PartialOrd derive 2025-03-21 12:14:39 +01:00
Lukas Wirth
d31301cbe7 refactor: Reduce codegen burden for SyntaxNode and SyntaxToken 2025-03-21 12:14:39 +01:00
Lukas Wirth
d6dc1bf05e refactor: Reduce codegen burden for SyntaxKind 2025-03-21 12:14:39 +01:00
Lukas Wirth
a505420751 chore: Bump Edition::CURRENT to 2024 2025-03-17 12:29:19 +01:00
BenjaminBrienen
7535bb4661 cargo fmt 2025-03-15 21:32:01 +01:00
Prajwal S N
39391b0d38
fix(hir): VariantDef is impl HasSource
A new syntax node `ast::VariantDef` has been introduced to map between the HIR node and the AST.
The files have been updated with `cargo test -p xtask`.

Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-03-08 01:25:27 +05:30
Lukas Wirth
8f319240b4 Cleanup string handling in syntax highlighting 2025-03-01 17:44:29 +01:00
BenjaminBrienen
b19ef6b046 fix doc tests 2025-02-27 14:58:46 +01:00
BenjaminBrienen
bd7375a58f enable doctest 2025-02-27 14:58:46 +01:00
Lukas Wirth
6d68c475c7
Merge pull request #19191 from Veykril/push-yzzlosskwrxs
Remove `limit` crate in favor `usize`
2025-02-23 16:50:32 +00:00
Lukas Wirth
0b2e8166a1 Remove limit crate in favor usize 2025-02-23 17:35:09 +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
Lukas Wirth
07a09c154e
Merge pull request #19015 from Wilfred/mdbook
manual: Convert to mdbook
2025-01-28 16:19:37 +00:00
Shoyu Vanilla
7de0b2e75a feat: Implement default-field-values 2025-01-27 19:38:35 +09:00
Wilfred Hughes
deda58e8f1 manual: Convert to mdbook
Split manual.adoc into markdown files, one for each chapter.

For the parts of the manual that are generated from source code doc
comments, update the comments to use markdown syntax and update the
code generators to write to `generated.md` files.

For the weekly release, stop copying the .adoc files to the
`rust-analyzer/rust-analyzer.github.io` at release time. Instead,
we'll sync the manual hourly from this repository.

See https://github.com/rust-analyzer/rust-analyzer.github.io/pull/226
for the sync. This PR should be merged first, and that PR needs to be
merged before the next weekly release.

This change is based on #15795, but rebased and updated. I've also
manually checked each page for markdown syntax issues and fixed any I
encountered.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Co-authored-by: Josh Rotenberg <joshrotenberg@gmail.com>
2025-01-24 13:23:22 -08: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
jnyfah
2ac6cb1521 revert blocklike changes 2025-01-16 12:54:26 +01:00
jnyfah
e3deeec2f2 update blocklike 2025-01-16 12:11:55 +01:00
lh123
9809143562 feat: complete raw, const keyword 2025-01-16 18:27:59 +08:00
jnyfah
11717ca5d4 Missing errors 2025-01-10 14:22:00 +01:00
Lukas Wirth
4b6007115a minor: New clippy lints 2025-01-06 17:57:17 +01:00
Chayim Refael Friedman
505e82c19c Add a function to convert a SyntaxKind to its text, where possible
This will also help for the make's quote macro.
2024-12-30 04:01:05 +02:00
Erithax
c7f5021de1
fix doc typo 2024-12-27 23:13:09 +01: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
Chayim Refael Friedman
0b7a6f38d7 Properly handle different defaults for severity of lints
Previously all lints were assumed to be `#[warn]`, and we had a hand-coded list of `#[allow]` exceptions. Now the severity is autogenerated from rustdoc output.

Also support lints that change status between editions, and the `warnings` lint group.
2024-12-11 20:48:41 +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