about summary refs log tree commit diff
path: root/src/tools/rust-analyzer
AgeCommit message (Collapse)AuthorLines
2025-07-11Merge pull request #20224 from Hmikihiro/migrate_remove_dbgShoyu Vanilla (Flint)-43/+44
Migrate `remove_dbg` assist to use `SyntaxEditor`
2025-07-11Migrate `remove_dbg` assist to use `SyntaxEditor`Hayashi Mikihiro-43/+44
2025-07-11Rollup merge of #143708 - epage:pretty, r=compiler-errorsMatthias Krüger-6/+8
fix: Include frontmatter in -Zunpretty output In the implementation (rust-lang/rust#140035), this was left as an open question for the tracking issue (rust-lang/rust#136889). My assumption is that this should be carried over. The test was carried over from rust-lang/rust#137193 which was superseded by rust-lang/rust#140035. Thankfully, either way, `-Zunpretty` is unstable and we can always change it even if we stabilize frontmatter.
2025-07-11update cargo_metadata to 0.21.0asahi-myzk-5/+36
2025-07-10Merge pull request #20228 from ChayimFriedman2/fix-use-displayChayim Refael Friedman-0/+1
fix: Fix display of `use<>` syntax
2025-07-11Fix display of `use<>` syntaxChayim Refael Friedman-0/+1
2025-07-10Merge pull request #20054 from Young-Flash/folding_allShoyu Vanilla (Flint)-3/+52
feat: support folding multiline arg list & fn body in one folding range
2025-07-10Migrate `generate_impl` assist to use `SyntaxEditor`Hayashi Mikihiro-9/+16
2025-07-10Merge pull request #20210 from ChayimFriedman2/naked-asm-safeShoyu Vanilla (Flint)-84/+303
fix: Inline asm fixes
2025-07-10remove unnecessary parens in rust-analyzeryukang-1/+1
2025-07-10Revert "remove `if-let` chains"Laurențiu Nicola-7/+6
This reverts commit fcc81a38b3ed55447735f71e8d374fcb36c22f24.
2025-07-10Merge pull request #20212 from ChayimFriedman2/dyn-hintShoyu Vanilla (Flint)-5/+31
fix: Fixes for `dyn` inlay hint
2025-07-10Migrate `convert_match_to_let_else` assist to use `SyntaxEditor`Hayashi Mikihiro-13/+15
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-10Put the expression stuff in the expression store behind an `Option<Box>`Chayim Refael Friedman-271/+419
And leave only the type stuff without it. This is because most expression stores don't have anything but types (e.g. generics, fields, signatures) so this saves a lot of memory. This saves 58mb on `analysis-stats .`.
2025-07-09feat(lexer): Allow including frontmatter with 'tokenize'Ed Page-6/+8
2025-07-09Make `AsmExpr` have `AstId`Chayim Refael Friedman-10/+29
We need it because `global_asm!()` is an item. It's unfortunate that such thing can slip in and I see no way to automatically catch that, but thankfully analysis-stats on self has caught that.
2025-07-09Merge pull request #20214 from rust-lang/update-msrvChayim Refael Friedman-1/+1
Update MSRV to 1.88.0
2025-07-09Update MSRV to 1.88.0Chayim Refael Friedman-1/+1
2025-07-09Put `dyn` inlay hints in their correct place in presence of parenthesesChayim Refael Friedman-3/+14
2025-07-09Disable the `diagnostics_dont_block_typing` test on CIChayim Refael Friedman-1/+2
It's failing to much. We need to fix it, but my changes are unlikely to be the cause.
2025-07-09Don't show `dyn` hint in a HRTB boundChayim Refael Friedman-2/+17
2025-07-10migrate `convert_named_struct_to_tuple_struct` assist to use 'SyntaxEditor'Hayashi Mikihiro-6/+9
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-09Make `global_asm!()` workChayim Refael Friedman-36/+58
Because apparently, we were not accepting inline asm in item position, completely breaking it.
2025-07-09Merge pull request #20109 from Hmikihiro/generate_new_tuple_fieldShoyu Vanilla (Flint)-24/+385
feat: Generate `new` for tuple struct
2025-07-09Differentiate between `asm!()`, `global_asm!()` and `naked_asm!()`, and make ↵Chayim Refael Friedman-16/+198
only `asm!()` unsafe
2025-07-09Don't hash the `SyntaxKind` in the ast idChayim Refael Friedman-41/+36
There is no need to, it's already stored in the `kind`.
2025-07-09Auto merge of #143472 - dianne:deref-pat-column-check, r=Nadrierilbors-0/+8
`rustc_pattern_analysis`: always check that deref patterns don't match on the same place as normal constructors In rust-lang/rust#140106, deref pattern validation was tied to the `deref_patterns` feature to temporarily avoid affecting perf. However: - As of rust-lang/rust#143414, box patterns are represented as deref patterns in `rustc_pattern_analysis`. Since they can be used by enabling `box_patterns` instead of `deref_patterns`, it was possible for them to skip validation, resulting in an ICE. This fixes that and adds a regression test. - External tooling (e.g. rust-analyzer) will also need to validate matches containing deref patterns, which was not possible. This fixes that by making `compute_match_usefulness` validate deref patterns by default. In order to avoid doing an extra pass for anything with patterns, the second commit makes `RustcPatCtxt` keep track of whether it encounters a deref pattern, so that it only does the check if so. This is purely for performance. If the perf impact of the first commit is negligible and the complexity cost introduced by the second commit is significant, it may be worth dropping the latter. r? `@Nadrieril`
2025-07-09Merge pull request #20200 from rust-lang/revert-20157-push-nxrvpywtvoysShoyu Vanilla (Flint)-13/+13
Revert "Re-enable fixpoint iteration for variance computation"
2025-07-08Revert "Re-enable fixpoint iteration for variance computation"Chayim Refael Friedman-13/+13
2025-07-09Migrate `pull_assignment_up` assist to `SyntaxEditor`Hayashi Mikihiro-27/+59
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-08Merge pull request #20192 from ChayimFriedman2/link-type-panicLukas Wirth-3/+30
fix: Fix a case where the link type was `None`
2025-07-07Auto merge of #143601 - matthiaskrgr:rollup-9iw2sqk, r=matthiaskrgrbors-25/+25
Rollup of 9 pull requests Successful merges: - rust-lang/rust#132469 (Do not suggest borrow that is already there in fully-qualified call) - rust-lang/rust#143340 (awhile -> a while where appropriate) - rust-lang/rust#143438 (Fix the link in `rustdoc.md`) - rust-lang/rust#143539 (Regression tests for repr ICEs) - rust-lang/rust#143566 (Fix `x86_64-unknown-netbsd` platform support page) - rust-lang/rust#143572 (Remove unused allow attrs) - rust-lang/rust#143583 (`loop_match`: fix 'no terminator on block') - rust-lang/rust#143584 (make `Machine::load_mir` infallible) - rust-lang/rust#143591 (Fix missing words in future tracking issue) r? `@ghost` `@rustbot` modify labels: rollup
2025-07-07Merge pull request #20180 from ChayimFriedman2/parser-stuckLukas Wirth-8/+50
fix: Always bump in the parser in `err_and_bump()`
2025-07-07Rollup merge of #143340 - nabijaczleweli:awhile, r=mati865Matthias Krüger-25/+25
awhile -> a while where appropriate
2025-07-07Fix a case where the link type was `None`Chayim Refael Friedman-3/+30
Which caused a panic.
2025-07-07Auto merge of #143182 - xdoardo:more-addrspace, r=workingjubileebors-5/+6
Allow custom default address spaces and parse `p-` specifications in the datalayout string Some targets, such as CHERI, use as default an address space different from the "normal" default address space `0` (in the case of CHERI, [200 is used](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-877.pdf)). Currently, `rustc` does not allow to specify custom address spaces and does not take into consideration [`p-` specifications in the datalayout string](https://llvm.org/docs/LangRef.html#langref-datalayout). This patch tries to mitigate these problems by allowing targets to define a custom default address space (while keeping the default value to address space `0`) and adding the code to parse the `p-` specifications in `rustc_abi`. The main changes are that `TargetDataLayout` now uses functions to refer to pointer-related informations, instead of having specific fields for the size and alignment of pointers in the default address space; furthermore, the two `pointer_size` and `pointer_align` fields in `TargetDataLayout` are replaced with an `FxHashMap` that holds info for all the possible address spaces, as parsed by the `p-` specifications. The potential performance drawbacks of not having ad-hoc fields for the default address space will be tested in this PR's CI run. r? workingjubilee
2025-07-07Merge pull request #20185 from ChayimFriedman2/variant-symbolsDavid Barsky-0/+75
feat: Include enum variants in world symbols
2025-07-07compiler: Parse `p-` specs in datalayout string, allow definition of custom ↵Edoardo Marangoni-5/+6
default data address space
2025-07-06Include enum variants in world symbolsChayim Refael Friedman-0/+75
I opted to not include enum variant imports, only under the enum, and to not gate this behind a setting.
2025-07-06Merge pull request #20184 from Veykril/push-ywpynxnltpokLukas Wirth-32/+44
chore: Remove dead field from `InferenceContext`
2025-07-06chore: Remove dead field from `InferenceContext`Lukas Wirth-32/+44
2025-07-06Merge pull request #20132 from A4-Tacks/asmut-borrow-minicoreLukas Wirth-0/+34
Add AsMut, Borrow and BorrowMut to minicore and famous_defs
2025-07-06Merge pull request #20126 from Wilfred/no_unwrap_in_discover_projectsLukas Wirth-3/+8
fix: Avoid .unwrap() when running the discover command
2025-07-06Merge pull request #20179 from ChayimFriedman2/destructuring-assignment-neverLukas Wirth-2/+61
fix: Fix diverging destructuring assignments
2025-07-06Merge pull request #20175 from dianne/match-check-box-cleanupChayim Refael Friedman-60/+20
`hir_ty::match_check` cleanup: remove special handling for box patterns
2025-07-06Always bump in the parser in `err_and_bump()`Chayim Refael Friedman-8/+50
Even when at curly braces, otherwise the parser can get stuck. This has happened in the past in #18625, but it was just worked around instead of handling the root of the problem. Now this happened again in #20171. IMO we can't let `err_and_bump()` not bump, that's too confusing and invites errors. We can (as I did) workaround the worse recovery instead.
2025-07-05Fix diverging destructuring assignmentsChayim Refael Friedman-2/+61
They need to return `!`, unlike diverging ordinary assignments. See the comment in the code.
2025-07-05Fix Borrow and BorrowMut define from beta stdA4-Tacks-2/+2
2025-07-04always check for mixed deref pattern and normal constructorsdianne-0/+8
This makes it work for box patterns and in rust-analyzer.
2025-07-04`hir_ty::match_check`: remove special handling for box patternsdianne-60/+20